Seven states that sued to block the DACA program couldn’t demonstrate that permitting it to continue was causing irreparable harm, a federal judge said on Friday, declining to halt the Obama-era policy that protects young illegal immigrants from deportation.

U.S. District Judge Andrew Hanen, who has previously ruled against DACA-related programs, argued that the states waited too long to seek a preliminary injunction.

"Here, the egg has been scrambled,” Hanen wrote in his ruling. “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.”

Still, Hanen said that he thinks the program, which stands for Deferred Action for Childhood Arrivals program, is unconstitutional. "If the nation truly wants to have a DACA program, it is up to Congress to say so," Hanen wrote.

"As the Justice Department has consistently argued, DACA is an unlawful attempt to circumvent Congress, and we are pleased the court agreed today," Justice Department spokesman Devin O'Malley said.

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 former President Barack Obama never had the authority to create a program like DACA because it circumvented Congress.

WHAT IS DACA AND WHAT DOES THE TRUMP ADMINISTRATION WANT TO DO WITH IT?

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 President Trump tried to end the program last year.

The DACA program was formed through executive action by Obama in 2012 and allowed certain people who came to the U.S. illegally as minors to be protected from immediate deportation. Recipients, called Dreamers, were able to request “consideration of deferred action” for a period of two years, which was subject to renewal.

Fox News’ Kaitlyn Schallhorn and The Associated Press contributed to this report