A federal appeals court ruled Wednesday that Homeland Security officials must quickly release immigrant children — but not their parents — from family detention centers after being picked up crossing the border without documentation.

The San Francisco-based 9th Circuit U.S. Court of Appeals said that lengthy detentions of migrant children violated a 19-year-old legal settlement ordering their quick release after processing. Government lawyers had argued that the settlement covered only immigrant children who crossed the border unaccompanied by adult relatives. But the three-judge panel ruled that immigration officials aren't required to release the parents detained along with the children, reversing U.S. District Judge Dolly Gee's ruling last year.

Advocates seeking stricter immigration controls said they hoped the ruling would discourage adults crossing the border illegally from exploiting children as a way to stay out of custody in the United States.

Mark Krikorian, Center for Immigration Studies executive director and an advocate for stricter border controls, said allowing the parents to be released may have encouraged illegal immigration of adults traveling with children.