A 10-year-old girl in Texas with cerebral palsy faces deportation after being discharged from a hospital where she just had surgery.

Rosa Maria Hernandez, who is undocumented but has lived in the US since she was 3 months old, and her cousin were confronted around 2 a.m. Tuesday by Border Patrol agents.

Rosa Maria and her cousin, who is a US citizen, were in an ambulance and being transferred between two hospitals so the little girl could undergo emergency gall bladder surgery at Driscoll Children’s Hospital in Corpus Christi, the Caller-Times reported.

The ambulance was escorted by immigration agents to the hospital from an immigration checkpoint in Freer. Border Patrol agents waited outside the girl’s hospital room until she was released from the facility.

Upon her release, Rosa Maria was taken to a shelter in San Antonio that holds migrant children who arrive alone in the US — despite doctor’s orders that she visit with her family’s primary care physician in Laredo post-surgery, according to the New York Times and Caller-Times.

“Their orders are to process her,” said Leticia Gonzalez, who works with the girl’s immigration lawyer, Alex Galvez. “At this point, our argument to [immigration officials] is there is a doctor’s directive, why aren’t you following it?”

Rosa Maria has lived in Laredo since being brought by her parents from Mexico to the US illegally as a baby.

A Customs and Border Protection spokesman said Rosa Maria was no exception to the agency’s responsibility to follow immigration law.

“Per the immigration laws of the United States, once medically cleared she will be processed accordingly,” Rod Kise said in a statement. “The Mexican Consulate has been advised of the situation by Laredo Sector Border Patrol.”

Galvez said Homeland Security officials will conduct a home study to see if the girl can be released to family. He said her case will be expedited and that it’s strong because she’s not a flight risk due to her disability and doesn’t pose a threat to society.

Rosa Maria’s mother, Felipa de la Cruz, said they crossed the border in hopes of getting medical treatment for her cerebral palsy. The family wasn’t able to afford therapy in Mexico but in Texas, Medicaid paid for the girl’s treatment, de la Cruz said.

“I’m a mother. All I wanted was for her to get the surgery that she needed,” de la Cruz told the New York Times. “It never crossed my mind that any of what is happening right now could happen. When you’re a mother, all you care about is your child.”