Child Protective Services should not have seized more than 450 children from the YFZ Ranch near Eldorado, the Texas Supreme Court ruled Thursday, moving families from the polygamist sect a large step closer to reunification.

The almost unanimous decision — three judges filed a separate opinion disagreeing with part of the ruling — is a blow to CPS efforts to keep the children in foster care.

CPS removed the children in April, alleging that the brand of polygamy practiced at the West Texas ranch meant that underage girls are groomed to become brides, and sex partners, to much older men.

“Removal of the children was not warranted,” the court opinion states.

Supreme Court justices brushed aside CPS objections that reunited families would flee to towns in Arizona and Utah where the Fundamentalist Church of Jesus Christ of Latter Day Saints, a breakaway Mormon sect that owns the ranch, is based.

The trial court can make orders “for the safety and welfare of the child” — including restricting sect families from leaving Texas, the court said.

Last week, the Third Court of Appeals ordered more than 120 children, seized in April from the YFZ Ranch near Eldorado, to be returned to 38 mothers who had filed the appeal. CPS failed to prove that the sect’s children were in immediate danger, as required by law, the Austin-based appeals court ruled.

CPS lawyers responded by asking the Supreme Court to void the ruling and issue an emergency stay delaying the family reunions.

The Supreme Court justices never acted on the emergency stay. Instead, on Wednesday afternoon they told the mothers’ lawyers to file a reply brief by 9 a.m. today — a tight deadline that signaled the court’s intention to make a quick ruling.

The state’s highest civil court made its ruling without hearing oral arguments.