The 10-year-old, Rosa Maria Hernandez, was taken this week from the Texas border city of Laredo to a Corpus Christi children's hospital.
A family attorney says agents let her through a checkpoint separating the cities, but followed her and a cousin to the hospital, and refused to release her after the surgery.
Rosa Maria is in the US without legal permission.
She was instead taken to a federal facility for unaccompanied minors in San Antonio, where she could be held for several weeks.
Disclaimer: No Business Standard Journalist was involved in creation of this content