HOUSTON (CBSDFW.COM/AP) — A federal judge on Friday declined to order that the U.S. government halt an Obama-era program that shields young immigrants from deportation, marking a blow to President Donald Trump and other opponents of the Deferred Action for Childhood Arrivals program.

U.S. District Judge Andrew Hanen said Texas and six other conservative states that sued to block DACA couldn’t prove that allowing the program to continue was causing irreparable harm. The judge questioned the legality of DACA but argued that more harm would be done to DACA recipients if they lost the program.

Immigrants and supporters rally and march in opposition to the President Trump order to end DACA, on September 5, 2017 in Los Angeles, United States. (credit: David McNew/Getty Images)

The judge, who has ruled against DACA-related programs in the past, essentially said the states waited too long to ask for the preliminary injunction.

“Here, the egg has been scrambled. To try to put it back in the shell with only a preliminary injunction record, and perhaps at great risk to many, does not make sense nor serve the best interests of this country,” Hanen wrote in his ruling.

The states filed the lawsuit in Texas, hoping Hanen would stop DACA recipients from continuing to renew their enrollment. That would have triggered a conflict with three federal orders that have required the U.S. government to keep accepting DACA renewals, even after Trump tried to end the program last year. Legal experts say such a conflict would have drawn the attention of the U.S. Supreme Court.

With the Trump administration now opposing the program, some states that support DACA — along with the Mexican American Legal Defense and Educational Fund, or MALDEF — intervened in the lawsuit to defend the program.

The lawsuit followed the same strategy that stopped an expansion of DACA also proposed by former President Barack Obama’s administration. After Obama announced he would create a program protecting the parents of children in the U.S. without legal permission, Texas sued in federal court in Brownsville, Texas, where Hanen is based.

Hanen ended up with that case and ruled the expansion of protections was unconstitutional. In that case, an appeals court upheld his ruling, and the Supreme Court split 4-4 after the death of Justice Antonin Scalia, leaving the ruling in place.

On Friday, Texas Attorney General Ken Paxton said he was confident the courts would ultimately find DACA unconstitutional. He said an injunction was denied only because the states waited too long to request it.

Texas was joined in filing the lawsuit by Alabama, Arkansas, Louisiana, Nebraska, South Carolina and West Virginia. The states argued that Obama, as president, never had the authority to create a program like DACA because it circumvented Congress.

The state also cited costs to educate immigrants, which lawyers for MALDEF argued were “both irrelevant and grossly inflated.” The group also said that unlike the program Hanen struck down, which never went into effect, DACA has allowed hundreds of thousands of people to work and pay taxes in the six years since it started. That, the group argued, benefits federal and state governments.

MALDEF said it was happy with the decision and expects the states to appeal to a higher court.

“Today DACA beneficiaries like myself and my little sister breathe a sigh of relief. We all know DACA works,” said Greisa Martinez Rosas, the deputy executive director of United We Dream.

Democratic nominee for Texas Governor, Lupe Valdez issued the following statement:

I am relieved by today’s victory for DREAMers in Texas and the United States, however — the presumption Ken Paxton claims that DACA causes states more harm than good is false. Texas is home to 120,000 DREAMers who are our teachers, our first responders, our small business owners and our innovators. DREAMers contribute $6.3 Billion to the Texas economy and Texas is the only home they have ever known.

“Regardless of the hate and intolerance from Greg Abbott, Ken Paxton and the Trump Republican Party, we won’t stop fighting for a fairer Texas. Thank you to DREAMers, MALC and MALDEF for risking it all to fight for what is right — but this fight is far from over. We have the power to bring change and create a permanent solution for millions of DREAMers in November.”

Cristina Jimenez, Executive Director of United We Dream Action issued the following statement:

“Today, DACA recipients and our families can breathe a sigh of relief. For DACA recipients like my brother, there are no changes at this time. Those with DACA may be able to renew and those who don’t have it yet cannot.

“Trump was wrong to kill DACA and the Republican-controlled Congress was wrong to kill the Dream Act. In fact, if Congress if had passed the Dream Act, there would be no court case and no uncertainty. We need a Congress that will protect immigrants and pass the clean Dream Act!

“That is why the young people of United We Dream Action are going door-to-door, phone banking, running digital ads, reaching voters on social media, whatever it takes to get a Congress that our communities deserve.

“We’re bringing the same energy we brought to the fight for DACA and the Dream Act to reach 500,000 voters and elect new champions in Congress who will protect immigrant youth and people of color.”

(© Copyright 2018 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)