The embattled operators of an Arizona long-term care facility have agreed to be regulated by the state, effectively ending a plan to close down the unit where an incapacitated woman gave birth after being raped.

Patrick Ptak, spokesman for Governor Doug Ducey, said the state received written confirmation that Hacienda HealthCare would enter into a voluntary regulation agreement.

“This is good news and the best immediate outcome as it means Hacienda patients and families would be allowed to stay in the home they’ve known for years while ensuring new and enhanced protections and oversight are put in place,” Mr Ptak said in a statement.

Under the agreement, Hacienda will have to devise a long-term plan and timeline that priorities health and safety at the intermediate care facility where the victim resided.

Hacienda will also have to employ an on-site evaluator to make sure necessary changes have been met.

The care provider will have to work with an outside health care consultant until the state finds it is in compliance. All these conditions will also apply to the skilled nursing facility, which shares the same campus.

State agencies had issued an ultimatum after Hacienda HealthCare announced its decision to shut down on Thursday.

The provider would have to comply with an order to hire a long-term third-party management team. The other option was to allow the state Department of Health Services to hold licensing authority over the facility.

A closure would have forced the relocation of nearly 40 intellectually disabled patients, some of who are medically fragile.

State regulators vehemently opposed the idea. They also argued Hacienda contractually requires written consent from the state Department of Economic Security to close any operation.

The facility has been in turmoil since a 29-year-old patient gave birth on December 29. Nathan Sutherland, a nurse whose DNA police said matches a sample from the baby, has pleaded not guilty to charges that he raped her.

Hacienda has struggled to meet the state’s request to hire a third-party management team to oversee daily operations.

The provider had said its board “after a great deal of careful consideration, has come to understand that it is simply not sustainable to continue to operate our intermediate care facility”.

Hacienda operates the only privately-run intermediate care facility in Arizona. It currently serves 37 intellectually disabled children and adults. It would take weeks or months to transition all of them to other places.

“It’s not something you can do overnight,” said Will Humble, a former director of the Department of Health Services.