(CNN) An undocumented 10-year-old girl with cerebral palsy was taken into US Customs and Border Protection custody shortly after emergency gallbladder surgery in Texas in a case that advocates say shows the harmful extent of the President's hard line on immigration policies.

On Tuesday, Rosa Maria Hernandez and her adult cousin, a US citizen, had to go through an interior Border Patrol checkpoint while in an ambulance to get from Laredo, Texas, to a Corpus Christi hospital for emergency gallbladder surgery, family attorney Leticia Gonzalez said Thursday.

Customs and Border Protection runs checkpoints along major thoroughfares leading away from the border in the Southwest, where travelers and vehicles are checked for legal authorization to enter the United States.

Border patrol agents determined that Rosa Maria was undocumented and followed the pair to the hospital, where the girl underwent surgery. The agents remained at the hospital until she was discharged into their custody, according to Gonzalez. In a statement, the agency said agents "escorted" the pair to the hospital.

Rosa Maria is now in a shelter run by the Office of Refugee Resettlement, which falls under the Department of Health and Human Services, as is customary with undocumented, unaccompanied minors. The child remains without her parents, and it's unclear when she'll be released or what will happen to her, according to Gonzalez.

The family and their supporters characterized the apprehension as cruel and unnecessary, though immigration officials say the procedures were routine enforcement of the nation's immigration laws.

10 year old Maria Rosa is at a hospital & @CustomsBorder is right outside her room waiting to deport her Sign&Share https://t.co/IYVjAkF37w pic.twitter.com/bIkRJzYwSa — DreamActivist (@DreamAct) October 25, 2017

A child with special needs

Rosa Maria came to the United States from Mexico when she was 3 months old. She was diagnosed with cerebral palsy and has the mental capacity of a child half her age, according to her mother, Felipa De La Cruz, who said her daughter doesn't understand what's happening.

"I told her she was only there because she was recovering and when she was recovered that she could come with me," she said Thursday. "I start to think about her, and I want to start crying, and I become desperate."

De La Cruz was able to video chat with her daughter in the children's home, but she still doesn't know whether Rosa Maria will ever return home to Laredo.

While she was recovering in the hospital, up to four federal agents were stationed outside her open hospital room door, Gonzalez said. The agents did not allow Rosa Maria's cousin to close the door for privacy. After Gonzalez arrived and demanded privacy, citing attorney-client privilege, it was eventually allowed, she said.

"Anywhere the child went, even within the hospital, for studies to surgery, the agents followed," Gonzalez said.

In a statement, Customs and Border Protection said it was committed to enforcing the nation's immigration laws. "Due to the juvenile's medical condition, border patrol agents escorted her and her cousin to a Corpus Christi hospital where she could receive appropriate medical care. Per the immigration laws of the United States, once medically cleared she will be processed accordingly. The Mexican Consulate has been advised of the situation by Laredo Sector Border Patrol," the agency said.

Health and Human Services said in a statement that it "does not identify individual (unaccompanied alien children) and will not comment on specific cases."

Rep. Joaquin Castro, D-Texas, lambasted the Trump administration, saying that too many people who pose no threat to national security are being deported.

The Department of Homeland Security "claims to be prioritizing its apprehension but Rosa Maria is not a threat to anyone's safety. (Immigration and Customs Enforcement) has the discretion to release Rosa Maria anytime and they are choosing not to do so," the congressman said, though the girl is not in that agency's custody. "This is just one story but this administration's immigration policies are affecting families across Texas and across the nation."

An Immigration and Customs Enforcement official said the agency had no involvement in this specific case.

However, it has a "sensitive location" policy that prohibits routine enforcement arrests in hospitals, schools and churches, but that policy is distinct from Customs and Border Protection's enforcement at checkpoints, where travelers must show documentation.

ICE doesn't make arrests at sensitive locations like hospitals, schools, or churches except in the case of a serious public safety threat pic.twitter.com/Yudor4ed7S — ICE (@ICEgov) October 26, 2017

A family in distress

Rosa Maria remains in Health and Human Services custody, as virtually all undocumented unaccompanied minors are in immigration cases, the Immigration and Customs Enforcement official said.

The child's 85-year-old grandfather -- a legal permanent resident for 45 years -- petitioned Customs and Border Protection for custody of his granddaughter. His request was denied, Gonzalez said.

The Office of Refugee Resettlement has procedures for finding sponsors and guardians to whom they can release minors in its custody.

The hospital discharge papers indicate that due to Rosa Maria's diminished mental capacity, she needs to be cared for by people she knows and is comfortable with, her attorney said.

Typically in these types of cases, the office will find a sponsor for the minor, and then the notice to appear -- which triggers immigration court proceedings -- will be transferred to Immigration and Customs Enforcement's local Enforcement and Removal Operations field office, the official said.

Follow CNN Health on Facebook and Twitter See the latest news and share your comments with CNN Health on Facebook and Twitter.

That notice to appear usually comes from Customs and Border Protection once they encounter and process the individual. Enforcement and Removal Operations will file the notice with the immigration court, and a court date will be scheduled to begin removal proceedings.

An immigration judge makes the final ruling on whether to provide some sort of relief for the individual or could issue a final removal order, clearing the way for deportation, the official said.

JUST WATCHED Meet the guardian to over 800 children Replay More Videos ... MUST WATCH Meet the guardian to over 800 children 03:12

The immigration court process can take years, and even after a removal order is issued, individuals can appeal the decision through the courts. Local immigration prosecutors can use some discretion as to who they prioritize for deportation proceedings, and President Barack Obama issued clear guidelines that prioritized public safety threats for immigration enforcement. The Trump administration, however, has said it may prioritize who it targets for enforcement but has made clear that any undocumented immigrant encountered by officers could end up in deportation proceedings.

The family has been told by immigration officials that Rosa Maria's case will be processed on an expedited time frame, but no specific time frame was given, Gonzalez said.

"It's painful for me to know that she's there and that I can't be tending to her now that she needs me," De La Cruz said.

"It's a sad day in America," Gonzalez said.