PHOENIX – One day after Hacienda HealthCare announced it would close its intermediate care facility where a patient was raped, the state has stepped in to keep it open.

"Given the high medical risks associated with transferring these patients, moving this medically fragile community is the option of last resort and not the state's goal," says a joint statement from the Arizona Department of Economic Security and the state's Medicaid program.

Officials with those two state agencies on Friday pushed back on Hacienda's announcement that it would close the 60-bed facility and instead gave the non-profit entity an ultimatum: Bring in a third-party manager or allow the state health department to assume licensing authority.

Hacienda HealthCare chose the latter, allowing the Arizona Department of Health Services to assume licensing authority over Hacienda's intermediate care facility for people with intellectual disabilities, though state officials stressed that an agreement between the two entities still needs to be reached.

More:Former Hacienda nurse accused of sexually assaulting patient pleads not guilty

Allowing the state to have that authority gives it more oversight over the operations, said Heidi Capriotti, a spokeswoman for the Arizona Health Care Cost Containment System, which is the state's Medicaid program.

The facility is not currently licensed by the state due to a 1997 Arizona law that exempts intermediate care facilities from state licensing. Two Arizona senators introduced a bill this session to remove that exemption after the news about Hacienda came to light.

At last count the facility had 37 patients. In its most recent federal survey, facility officials listed the patients as ranging in age from 16 to 68 and most were listed as "non-ambulatory."

The patient who was raped is a 29-year-old member of the San Carlos Apache Tribe who has a seizure disorder and is described in court documents as being non-verbal, incapacitated and needing a "maximum level of care."

More:'No idea': Nurse's 911 call details surprise birth

On Dec. 29 the patient gave birth to a boy as staff from the facility called 911 and indicated they had not known she was pregnant.

On Jan. 23 one of her caregivers at Hacienda was arrested. Licensed practical nurse Nathan Sutherland, 36. has been charged with one count of sexual assault and one count of vulnerable-adult abuse.

The state's numerous directives to Hacienda over the last month have been, "often rushed and onerous," says a letter dated Friday to AHCCCS and the Arizona Department of Economic Security from Hacienda board president Thomas R. Pomeroy,

In light of the state's demands on Hacienda, "we appreciate you telling us that the state did not intend to close down," the intermediate care facility, Pomeroy wrote.

"We could not agree more that the safety and well-being of our residents are of paramount priority and that we should collectively work to ensure that our residents and their families have maximum flexibility in choosing where they reside."

Among improvements, Pomeroy wrote that Hacienda has retained three armed off-duty police officers 24 hours per day, seven days per week, and has installed 30 internal cameras to capture all common areas and entrances and exits from the building.

In addition, Hacienda is continuing with 15-minute checks on all patient rooms, and is in the process of retaining a director of security, Pomeroy wrote.

"This is good news and the best immediate outcome as it means Hacienda patients and families would be allowed to say in the home they've known for years while ensuring new and enhanced protections and oversight are put in place," Patrick Ptak, a spokesman for Gov. Doug Ducey, said in a released statement.

"Due to the medically fragile condition of this community, keeping patients where they reside was always our preferred choice and the safest option for patients

."