"On the record before us, removal of the children was not warranted," the justices said in their ruling issued in Austin.
The high court let stand the appellate court's order that Texas District Judge Barbara Walther return the children from foster care to their parents. It's not clear how soon that may happen, but the appellate court ordered her to do it within a reasonable time period.
The ruling shatters one of the largest child-custody cases in U.S. history. State officials said the removals were necessary to end a cycle of sexual abuse at the ranch in which teenage girls were forced to marry and have sex with older men, but parents denied any abuse and said they were being persecuted for their religious beliefs.
Word of the high court's ruling spread immediately through e-mail and phone calls, said Cynthia Martinez, a spokeswoman for legal aid attorneys representing the 38 mothers named in the case.
"The moms are clearly very happy at the news that it looks like they're going to get their kids a lot sooner than expected," she said. "It's definitely an emotional day."
The case before the court technically only applies to the 124 children of those mothers who filed the complaint that prompted the ruling, but it significantly affects nearly all the children since they were removed under identical circumstances.
Roughly 430 children are now in foster care after two births, numerous reclassifications of adult women initially held as minors and a handful of agreements allowing parents to keep custody while the Supreme Court considered the case.
The ruling does not force CPS to end its involvement with the parents from the Fundamentalist Church of Jesus Christ of Latter Day Saints, which runs the ranch in Eldorado, however.
The justices said child welfare officials can take numerous actions to protect children short of separating them from their parents and placing them in foster care and that Walther may still put restrictions on the children and parents to address concerns that they may flee once reunited.
The FLDS teaches that polygamy brings glorification in heaven. It is a breakaway sect of the Mormon church, which renounced polygamy more than a century ago.
Texas officials claimed at one point that there were 31 teenage girls at the ranch who were pregnant or had been pregnant, but later conceded that about half of those mothers, if not more, were adults. One was 27.
Under Texas law, children can be taken from their parents if there's a danger to their physical safety, an urgent need for protection and if officials made a reasonable effort to keep the children in their homes. The high court agreed with the appellate court that the seizures fell short of that standard.