Now playing
04:16
The fight over immigration is decades old
Michael Caputo
PHOTO: CNN
Michael Caputo
Now playing
01:25
Caputo: Trump tired of Dems gaming on DACA
A group of Central Americans crossed into Mexico in March as part of a migrant "caravan" heading to the United States border.
PHOTO: CNN
A group of Central Americans crossed into Mexico in March as part of a migrant "caravan" heading to the United States border.
Now playing
02:07
Donald Trump: No more DACA deal
PHOTO: CNN
Now playing
01:38
Kaine: Trump could fix DACA if he wanted to
WASHINGTON, DC - JANUARY 09:  U.S. President Donald Trump (L) presides over a meeting about immigration with Republican and Democrat members of Congress in the Cabinet Room at the White House January 9, 2018 in Washington, DC. In addition to seeking bipartisan solutions to immigration reform, Trump advocated for the reintroduction of earmarks as a way to break the legislative stalemate in Congress.  (Photo by Chip Somodevilla/Getty Images)
PHOTO: Chip Somodevilla/Getty Images North America/Getty Images
WASHINGTON, DC - JANUARY 09: U.S. President Donald Trump (L) presides over a meeting about immigration with Republican and Democrat members of Congress in the Cabinet Room at the White House January 9, 2018 in Washington, DC. In addition to seeking bipartisan solutions to immigration reform, Trump advocated for the reintroduction of earmarks as a way to break the legislative stalemate in Congress. (Photo by Chip Somodevilla/Getty Images)
Now playing
01:12
Trump changes tone on immigration
PHOTO: CNN
Now playing
00:59
Pelosi: I'm going to go on as long as allowed
What is DACA?_00002803.jpg
What is DACA?_00002803.jpg
Now playing
01:57
What is DACA?
PHOTO: CNN
Now playing
00:54
White House wants permanent DACA solution
PHOTO: CNN
Now playing
01:33
Senators say McConnell willing to deal on DACA
WASHINGTON, DC - SEPTEMBER 6: Senate Minority Leader Chuck Schumer (D-NY) speaks at a news conference as other congressional leaders look on about President Donald Trump's decision to end the Deferred Action for Childhood Arrivals (DACA) program at the U.S. Capitol September 6, 2017 in Washington, DC. Democrats called for action on young undocumented immigrants that came to the U.S. as children who now could face deportation if Congress does not act.  (Photo by Aaron P. Bernstein/Getty Images)
PHOTO: Aaron P. Bernstein/Getty Images
WASHINGTON, DC - SEPTEMBER 6: Senate Minority Leader Chuck Schumer (D-NY) speaks at a news conference as other congressional leaders look on about President Donald Trump's decision to end the Deferred Action for Childhood Arrivals (DACA) program at the U.S. Capitol September 6, 2017 in Washington, DC. Democrats called for action on young undocumented immigrants that came to the U.S. as children who now could face deportation if Congress does not act. (Photo by Aaron P. Bernstein/Getty Images)
Now playing
01:11
Trump tweets DACA 'probably dead'
NEW YORK, NY - AUGUST 15:  Dozens of immigration advocates and supporters attend a rally outside of  Trump Tower along Fifth Avenue on August 15, 2017 in New York City. The activists were rallying on the five-year anniversary of President Obama's executive order, DACA - Deferred Action for Childhood Arrivals, protecting undocumented immigrants brought to the U.S. as children. Security throughout the area is high with President Donald Trump in residency at the tower, his first visit back to his apartment since his inauguration. Numerous protests and extensive road closures are planned for the area.  (Photo by Spencer Platt/Getty Images)
PHOTO: Spencer Platt/Getty Images
NEW YORK, NY - AUGUST 15: Dozens of immigration advocates and supporters attend a rally outside of Trump Tower along Fifth Avenue on August 15, 2017 in New York City. The activists were rallying on the five-year anniversary of President Obama's executive order, DACA - Deferred Action for Childhood Arrivals, protecting undocumented immigrants brought to the U.S. as children. Security throughout the area is high with President Donald Trump in residency at the tower, his first visit back to his apartment since his inauguration. Numerous protests and extensive road closures are planned for the area. (Photo by Spencer Platt/Getty Images)
Now playing
02:30
Trump's twists and turns on DACA
US President Donald Trump, and wife Melania step off Air Force One upon arrival at Palm Beach International Airport in West Palm Beach, Florida on January 12, 2018.
Trump is heading to Palm Beach, Florida where he is scheduled to spend the weekend at the Mar-a-Lago estate. / AFP PHOTO / Nicholas Kamm        (Photo credit should read NICHOLAS KAMM/AFP/Getty Images)
PHOTO: NICHOLAS KAMM/AFP/AFP/Getty Images
US President Donald Trump, and wife Melania step off Air Force One upon arrival at Palm Beach International Airport in West Palm Beach, Florida on January 12, 2018. Trump is heading to Palm Beach, Florida where he is scheduled to spend the weekend at the Mar-a-Lago estate. / AFP PHOTO / Nicholas Kamm (Photo credit should read NICHOLAS KAMM/AFP/Getty Images)
Now playing
02:01
Trump: Democrats don't want DACA deal
Trump
PHOTO: CNN
Trump
Now playing
01:12
Trump: Immigration bill must be 'bill of love'
Sen. Jeff FLake lead 12-20-17
PHOTO: CNN
Sen. Jeff FLake lead 12-20-17
Now playing
02:07
How Flake used his leverage to revisit DACA
pelosi dreamers event 1
PHOTO: KGO
pelosi dreamers event 1
Now playing
01:15
Protesters drown out Nancy Pelosi
What is DACA?_00002803.jpg
What is DACA?_00002803.jpg
Now playing
02:01
One of these bills could replace DACA
(CNN) —  

A federal judge on Friday hinted he will likely invalidate the Deferred Action for Childhood Arrivals program in the future – but for now the program can continue to operate.

The ruling was an unexpected, albeit temporary, reprieve for the program, which President Donald Trump opted to end almost exactly a year ago.

Texas-based District Judge Andrew Hanen wrote Friday that he believes DACA is likely illegal and ultimately will fail to survive a challenge before his court. DACA is an Obama-era program that protects young undocumented immigrants who came to the US as children from deportation.

But despite that – and despite finding that the continuation of DACA could harm the eight states and two governors who challenged the program – Hanen decided not to issue a ruling that would have immediately blocked DACA’s continuation.

Since Trump sought to end DACA last September, the program’s future has been in doubt. Members of Congress largely say they want to preserve the program legislatively, but have failed to pass anything in two opportunities to do so. In the meantime, three federal courts have sustained the program.

While Hanen rebuffed the red states’ request to end DACA immediately, his inclination to invalidate the program eventually contributes to what experts expect to be a fast track to the Supreme Court in the coming year.

Hanen said that there were two issues that required him to deny the request to immediately halt the program: One was timeliness. He found that because Texas and its coalition of states waited more than five years after the implementation of DACA, even as it challenged a related program, to file this suit, that it lost some of its ability to claim damages were immediately harmful and thus required an immediate response.

In addition, Hanen ruled that though the states could prove they were harmed by the continuation of DACA, mainly in costs of benefits to recipients, the potential consequences of ending DACA immediately were more harmful.

Three federal judges have blocked the administration from ending DACA as it tried to do last September, ordering the Department of Homeland Security to continue renewing permits under the program.

But Hanen was widely expected to be unfavorable to DACA, as he had previously prevented a similar, expanded program from ever going into effect under the Obama administration.

The new case challenging the DACA program, instituted in 2012, drew heavily from that decision Hanen made on the 2014 expansion of the program and creation of a similar program for undocumented parents of Americans.

Hanen said in his Friday ruling that he largely agreed, and DACA was likely to be illegal under the same reasoning as that expansion.

But one major difference prevented him from immediately halting the program – the fact that it was already in effect.

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

But in his 117-page decision, Hanen was clear that he did not intend his ruling to be interpreted as good news for the future of DACA, at least long term.

He said the popularity of the program was not relevant to whether it had been legally created – the crux of the challenge to it.

“DACA is a popular program and one that Conress should consider saving,” Hanen wrote. Nevertheless, “this court will not succumb to the temptation to set aside legal principles and to substitute its judgment in lieu of legislative action. If the nation truly wants to have a DACA program, it is up to Congress to say so.”

Texas Attorney General Ken Paxton, who led the challenge to DACA, hailed the ruling in a statement, despite it being an interim loss in court.

“We’re now very confident that DACA will soon meet the same fate as the Obama-era Deferred Action for Parents of Americans program, which the courts blocked after I led another state coalition challenging its constitutionality,” Paxton said. “Our lawsuit is vital to restoring the rule of law to our nation’s immigration system.”

Hanen’s ruling Friday defuses the threat to DACA for some time. In a separate order, Hanen took the unusual step of making it possible to appeal his denial of an immediate halt to the program, and gave the parties three weeks to figure out next steps before the case moves to its next phase.

The Department of Justice declined to defend DACA in the lawsuit, but did ask Hanen to limit the effect of any ruling he may have issued.

Spokesman Devin O’Malley said in a statement that Hanen had agreed DACA is unlawful, “as the Justice Department has consistently argued,” and said the department was “pleased” with the decision.

In the administration’s stead, DACA was defended by the pro-immigrant advocacy and legal organization MALDEF and the state of New Jersey.

In a statement Friday, MALDEF hailed the ruling but noted it still believes DACA to be legal.

“While MALDEF continues to disagree adamantly with the judge’s views on the legality of DACA under the Administrative Procedures Act (APA), and on whether the state of Texas even has standing – as required by the Constitution – to challenge DACA, today’s court decision appropriately leaves DACA in place with respect to over 100,000 Texans and hundreds of thousands of others nationwide,” said Thomas A. Saenz, president and general counsel of MALDEF.

This story has been updated.

CNN’s Ariane de Vogue and Jason Morris contributed to this report.