A federal judge in Texas has struck down the Indian Child Welfare Act, a decades-old federal law aimed at keeping Native American families together.

Backed by the state of Texas, Chad and Jennifer Brackeen — a non-Native American couple with two biological children — sued last October for the right to adopt a Native American toddler they had fostered for more than a year. A state court had denied their adoption petition; the federal law gives adoption placement preference to biological family members of Native American children, other members of the child’s tribe, or other Native American families.

Texas Attorney General Ken Paxton sided with the Brackeens, arguing that the law unlawfully “elevates a child’s race over their best interest.”

The Brackeens have since adopted the child and settled their case, but the challenge to the law itself pressed on. Texas, along with Louisiana and Indiana, argued that the law unconstitutionally discriminated on the basis of race and infringed on states’ rights to oversee their own child welfare proceedings.

U.S. District Judge Reed O’Connor on Thursday sided with Texas, ruling that the law is unconstitutional.

Passed in 1978, the law aims to preserve the integrity of Native American tribes. It came at a time when as many as one-third of tribal children were forcibly removed from their biological families in state welfare proceedings, a group of tribal leaders said Friday. Many of those removals were “wholly unjustified,” said representatives from the Cherokee Nation, Morongo Band of Mission Indians, Oneida Nation and Quinault Indian Nation in a statement condemning O’Connor’s decision.

“These policies devastated tribal communities and we refuse to go back to those darker days,” the group leaders said. “If ICWA is struck down in whole or in part, the victims will be our children and our families, Native children and Native families.”

The leaders, who had intervened in the case, said they are “exploring all available options,” including a stay to maintain the status quo temporarily, as well as an appeal to a higher court.

The Indian Child Welfare Act has long been a controversial law, seeking to balance tribal integrity and thorny child welfare decisions. In 2013, an Oklahoma case involving the law made it to the Supreme Court; the case left the law intact.

Paxton cheered O’Connor’s decision, arguing it protects state sovereignty as well as “the best interest of Texas children.”

“ICWA coerces state agencies and courts to carry out unconstitutional and illegal federal policy, and decide custody based on race,” Paxton said in a statement Friday.