A 7-year-old Guatemalan girl who has spent a record 233 days at the Berks County immigrant detention center has won an important legal appeal — but not one allowing her and her father to leave the facility together.

The decision late Thursday by the U.S. Court of Appeals for the Third Circuit addressed a different aspect of the case. The court ruled that Maddie, as she is identified, and her father, named in court as “Mr. H,” have the right to challenge the government’s authority to send them to Mexico while awaiting the outcome of their immigration proceedings. And, importantly, so do others in similar situations, the court ruled.

“This case raises the age-old question, ‘If not now, when?’” the court wrote. “For aliens who are challenging their removal from the United States, the answer is usually ‘later.’ But not always. And not here.”

The decision came after a federal judge in Philadelphia dismissed the family’s arguments. The appeals court returned the case to the district court.

The court ruling was precedential, which means it will be binding or persuasive for courts deciding subsequent cases with similar facts. Maddie has been confined longer than any child currently held in any of the nation’s three family detention centers, her attorneys said.

“Maddie’s case has made law that will help every immigrant child in detention in the United States,” said Amy Maldonado, a Michigan lawyer who represents the family. “This was a huge win.”

A Department of Justice spokesperson said the agency had no comment on the ruling.

The Trump administration has sent thousands of adult and child asylum-seekers to Mexico under its “Migrant Protection Protocols,” which advocates say typically leaves people homeless and stranded in dangerous cities.

The decision did not decide the issue of releasing Maddie and her father to join the child’s mother, who lives in New Jersey and has not been targeted for deportation. Last month, a federal judge in Philadelphia ruled that father and child “must show more than noble goals and an empathetic case” to win their joint release.

The government has offered to immediately release Maddie to her mother. But not freeing her father, the family’s lawyers argued, made the overture merely a different form of family separation, one they said would inflict more harm on a suffering child.

The Berks County Residential Center, as it’s formally called, is a 96-bed lockup about 75 miles northwest of Philadelphia, operated by the county through a contract with U.S. Immigration and Customs Enforcement.

Maddie and her father were detained last spring after illegally entering the United States near Tecate, Calif. They were soon sent to Mexico, where other returned migrants have reported being kidnapped, tortured, robbed, or raped.

In Tijuana, Maddie and her father were chased and threatened, their lawyers said, and survived mostly because a woman allowed them to live in her home. In June, father and daughter were permitted into the U.S. solely for their Immigration Court hearing.

Federal district courts rarely have the jurisdiction to hear deportation disputes, the appeals court wrote. Instead, migrants must litigate removal claims before an immigration judge and then, after a removal order is entered, before the Board of Immigration Appeals.

Only after that can a petition for review be filed with an appeals court.

“But some immigration claims cannot wait,” the Third Circuit wrote. “By the time there is a final removal to Guatemala (if that ever happens), it will be too late to review or remedy their return to Mexico in the meantime.”

The court said the Flores Settlement Agreement, which governs the detention, release, and treatment of children in immigration custody, applies if invoked, and that sending Maddie to Mexico would violate her rights under that agreement.