HOUSTON  A Texas appeals court ruled Thursday that state authorities and a lower court judge abused their authority by illegally seizing up to 468 children from their homes at a polygamist ranch in West Texas last month.

The rebuke threw the largest custody case in American history into turmoil, with some lawyers saying the children could soon be reunited with their families. Many of the mothers have been criss-crossing Texas visiting their children in foster homes.

According to the court, the state did not establish proper grounds to remove the children from their families, who belong to the Fundamentalist Church of Jesus Christ of Latter-day Saints, or F.L.D.S. The F.L.D.S. broke off from the mainstream Mormon church after it had disavowed polygamy in 1890.

The agency raided the Yearning for Zion ranch on April 3 after someone had called an abuse hot line and said that she was a 16-year-old child bride being abused by her older husband in the church’s compound. The caller has still not been found.