John Moore/Getty Images Immigration and Customs Enforcement agents say 24-hour care is available to Sara Beltran-Hernandez.

An undocumented woman from El Salvador awaiting brain surgery to remove a tumor was taken from a Texas hospital and detained by Immigration and Customs Enforcement agents Wednesday night, her legal team says.

Sara Beltran-Hernandez, 26, had been in immigration detention since November 2015 because she did not have proper documentation when she tried to migrate to New York City, according to the New York Daily News.

The mother of two had been held at Prairieland Detention Center in Alvarado, Texas, since Jan. 26, 2017, while her family members in New York tried to petition for her asylum. But she collapsed at the facility this month after experiencing severe headaches, nosebleeds and memory loss.

She was taken to Texas Health Huguley Hospital in Fort Worth on Feb. 11, where doctors diagnosed her with a brain tumor that required surgery.

Around 8 p.m. on Wednesday, a physician told ICE agents that Beltran-Hernandez was “stable.” She was subsequently discharged from the hospital and returned to ICE custody at Prairieland Detention Center. ICE is keeping her under observation and says that she has round-the-clock care available.

“Ms. Beltran will continue to have access to 24 hour emergency medical care and to any required specialized treatment at an outside facility,” ICE told The Huffington Post.

Beltran-Hernandez’s legal team criticized her treatment.

“They had her tied up from hands and ankles,” said Melissa Zuniga, a paralegal on the case, in a statement. “She was brought in a wheelchair and is not being given treatment even though her nose continues to bleed and she has told them her head is exploding.”

Beltran-Hernandez had been on a surgery waitlist as of this past weekend. But after her relatives had a distressing phone call with her Wednesday night, everything was put on hold, according to the Daily News.

John Moore/Getty Images Beltran-Hernandez is due to be released and sent back to the hospital in Texas “soon,” a legal representative told The Huffington Post.

During that call, Beltran-Hernandez’s lawyers say she couldn’t remember their names, even though they’ve worked with her on her asylum case for the past 13 months.

“It was clear that she had deteriorated in that time,” Zuniga told ABC News. “She sounded groggy and she wasn’t remembering things. We became even more concerned.”

The Department of Homeland Security had issued a statement late Tuesday saying that ICE officials had contacted the Beltran-Hernandez family’s attorneys to explain the proper procedure to get in touch with her.

“Requests by family members to visit ICE detainees who have been hospitalized are permitted but must be approved in advance with ICE and the appropriate consulate,” the agency wrote in the statement.

Shortly after she spoke to her family, Beltran-Hernandez was out of the hospital and back in the detention center.

Beltran-Hernandez’s legal team, accompanied by medical professionals, flew to Dallas Thursday morning to help “provide Sara with options regarding her mother and stepfather’s travel to her bedside in Texas” from New York City, Zuniga said.

Her mother and stepfather “both need special humanitarian parole for them to travel without fear of ICE detention,” Zuniga said.

ICE told HuffPost on Thursday that Beltran-Hernandez “was able to speak to her family and to her attorney of record by phone. She also met with her attorney of record and consular representative in person today.”

Zuniga said Thursday morning that Beltran-Hernandez was to be released and sent back to the hospital in Fort Worth “soon.”

Beltran-Hernandez’s medical records still have not been made available, Zuniga said. She urged the Salvadorian government and U.S. government to discuss the matter as soon as possible.

The legal team is concerned that Beltran-Hernandez’s children in El Salvador “may become immediate targets because Sara’s asylum claims have now become public record for all to see.” She’d like them to see their mother before her surgery, if possible, in case she dies, Zuniga added.