The Supreme Court announced Friday it will consider next term whether the Trump administration illegally tried to end the program that shields from deportation young undocumented immigrants brought to the United States as children.

Lower courts have said that President Trump’s decision to terminate the Obama-era program was based on faulty legal reasoning and that the administration has failed to provide a solid rationale for ending it.

The Supreme Court’s somewhat reluctant review of the Deferred Action for Childhood Arrivals (DACA) program means that, for the third consecutive year, the high court will pass judgment on a Trump priority that has been stifled by federal judges — this time in a presidential election year and in a case with passionate advocates and huge consequences.

The Supreme Court ended its term Thursday by putting on hold the Trump administration’s plan to put a citizenship question on the 2020 Census. In 2018, it narrowly approved the president’s travel ban on arrivals from a handful of mostly Muslim countries.

The DACA program has become politically volatile and the object of negotiations — to no end, so far — between Congress and the White House. Initiated in 2012 by a proclamation from President Barack Obama, DACA has protected from deportation nearly 700,000 people brought to the United States as children, a group that’s been labeled “dreamers.”

The justices have considered since January whether to review a ruling against the administration from the U.S. Court of Appeals for the 9th Circuit in California. It recently denied a request to expedite review of a decision of the U.S. Court of Appeals for the 4th Circuit.

A political solution that would relieve the court of having to decide the program’s legality has not been forthcoming. Some experts in the field have wondered if the court’s acceptance of the case, or a decision next term, might spur action.

The Trump administration moved to scuttle the program in 2017 after Texas and other states threatened to sue to force its end. Then-Attorney General Jeff Sessions advised the Department of Homeland Security that the program was probably unlawful and that it could not be defended.

Sessions based that decision on a ruling by the U.S. Court of Appeals for the 5th Circuit, which said that another Obama program protecting immigrants was beyond the president’s constitutional powers. The Supreme Court deadlocked 4 to 4 in 2016 when considering the issue.

But other courts have rejected that theory, saying DACA is different. They have kept the program in place, requiring that those already enrolled be allowed to renew their participation. California Attorney General Xavier Becerra (D), who is among those fighting the administration’s decision, said that more than 373,000 two-year renewals have been approved since January 2018.

Those approved to be in the program are allowed work permits and are protected from deportation, as long as they abide by its regulations and do not violate laws.

“DACA reflects our nation’s commitment to helping hardworking people and creates hope and opportunity for a new generation — many of whom were brought to our country as toddlers,” Becerra said in a statement after the Supreme Court announcement.

“So far, both lower courts in our legal fight to protect DACA have agreed with us that the Trump Administration’s attempt to end it was unlawful.”

Judges who have blocked ending the program have said the administration could remedy the legal impasse by providing a detailed reasoning of why the program should be abolished. Instead, it has continued to combat the orders in court.

The fight over the young people protected by the program — the average age is around 24 — has been a fierce battle between Trump and Democrats, who largely defend the initiative.

Trump at times has said he would like to find a way to protect those in the program, but attempts to work out a political compromise have foundered amid the larger partisan debate over immigration and border security.

The administration has been eager to get the issue before the Supreme Court, where it believes the more conservative wing will be on its side.

Solicitor General Noel J. Francisco, representing the administration at the Supreme Court, said in a brief that the cases “concern the Executive Branch’s authority to revoke a discretionary policy of non-enforcement that is sanctioning an ongoing violation of federal immigration law by nearly 700,000 aliens.”

So far, appeals courts in California, New York, Virginia and a district judge in the District of Columbia have said that reasoning is wrong. (A judge in Texas said the program was illegal but declined to rule that it should cease.) The judges who have ruled against the Department of Homeland Security’s justification for ending DACA say it must be based on more than just a belief about its legal underpinnings.

“To be clear: we do not hold that DACA could not be rescinded as an exercise of Executive Branch discretion,” Judge Kim McLane Wardlaw said in the 9th Circuit’s opinion. “We hold only that here, where the Executive did not make a discretionary choice to end DACA — but rather acted based on an erroneous view of what the law required — the rescission was arbitrary and capricious under settled law.”

The regents of the University of California, one of the parties challenging the administration, told the Supreme Court there was no hurry to take the case because each DACA recipient had been vetted by the federal government.

The university leadership quoted a tweet from Trump to argue that not even this administration was advocating immediate deportation.

“Does anybody really want to throw out good, educated and accomplished young people who have jobs, some serving in the military? Really!” the president tweeted in September.

The court accepted three cases, which will be consolidated for hearing in the new term that starts in October. They are Department of Homeland Security v. Regents of the University of California; Trump v. NAACP and McAleenan v. Vidal.

The court accepted a bundle of new cases Friday before the justices scattered for vacations and summer teaching gigs.

In one, it granted petitions from Bridget Kelly and Bill Baroni, two former aides to former New Jersey Gov. Chris Christie (R) who were convicted of felonies in 2016 for their parts in causing gridlock near the George Washington Bridge as retaliation against a mayor who did not support their boss.

The case is Kelly v. United States.

The justices said they will also review a Montana Supreme Court ruling invalidating a state program offering tax credits for funding scholarships. The scholarships could be used at private schools, including religious schools, and the court said that violated a prohibition in the state constitution.

The case is Espinoza v. Montana Department of Revenue.