The Supreme Court on Tuesday will once again review a controversial policy initiated by President Trump and blocked by lower courts, this time ahead of an election year and with the fate of nearly 700,000 “dreamers” brought to the United States as undocumented children hanging on the outcome.

The Trump administration has tried for more than two years to “wind down” the Deferred Action for Childhood Arrivals (DACA) program, announced by President Barack Obama in 2012 to protect from deportation qualified young immigrants who came to the country illegally.

Individual DACA recipients, giant corporations, civil rights groups and universities have challenged the administration’s plans, and won. Lower courts have found that the administration relied on faulty legal analysis for ending the program, rather than providing lawful reasons that the courts and the public could evaluate.

Nearly 800,000 people over the years have participated in the program, which provides a chance for enrollees to work legally in the United States as long as they follow the rules and have a clean record. More than 90 percent of DACA recipients are employed and 45 percent are in school, according to one government study.

Dozens of briefs have been filed in what will be one of the court’s marquee cases of the term, many of them only tangentially addressing the legal issues at play. Instead, they extol the doctors, lawyers, engineers, students and military officers whose accomplishments were made possible by the program.

Microsoft, which employs more than 60 DACA recipients, is a party to one of the lawsuits, and the tech giant’s president, Brad Smith, wrote in a recent blog post that “we represent employers of all sizes in making the case to uphold DACA.”

More than 140 companies filed a brief to show what Smith said was the “serious harm that would be inflicted on the economy if we were to lose the contributions of Dreamers.”

Even Trump has said that he considers DACA recipients hard-working and sympathetic, many of them thriving in the only country they have ever known. He said in a tweet last fall: “Does anybody really want to throw out good, educated and accomplished young people who have jobs, some serving in the military? Really!”

But Congress and the White House have been unable for years to come up with a permanent solution. Obama set up the program after negotiations over a comprehensive immigration reform plan failed. Democrats passed another measure to protect DACA recipients, but Trump and Republicans wanted a more extensive deal that would include the president’s plans to build a wall along the U.S.-Mexico border.

Most recently, Trump has said that a Supreme Court ruling in favor of his administration is necessary to bring Democrats back to the table.

“Rest assured that if the SC does what all say it must, based on the law, a bipartisan deal will be made to the benefit of all!” he tweeted in September.

The common thread in the Supreme Court showdowns over Trump’s authority has been the president making good on campaign pledges to tighten the nation’s borders and crack down on those in the United States illegally.

The justices ended their most recent term in June by stopping the administration’s plan to put a citizenship question on the 2020 Census. Even census experts said such a question was likely to deter noncitizens from returning the forms and impede an accurate population count.

The court ended its 2018 term by approving the president’s travel ban on visitors from a handful of mostly Muslim countries.

The only justice in the majority in both cases was Chief Justice John G. Roberts Jr., who also wrote both opinions. He will be the most closely watched justice when the court takes up the DACA case Tuesday.

In a sense, the DACA case combines the issues in the previous two.

Roberts, joined by the court’s most consistent conservatives, wrote in the travel ban decision that Congress has given the president “broad discretion” in immigration matters, and that Trump was lawfully using it to protect the country.

In the census decision, the court’s four liberals joined Roberts in his view that courts have a role in defining limits to that deference.

Agencies must offer “genuine justifications for important decisions, reasons that can be scrutinized by courts and the interested public,” Roberts wrote. “Accepting contrived reasons would defeat the purpose of the enterprise.”

In the DACA case, Solicitor General Noel J. Francisco said in a brief to the Supreme Court that the judiciary has no authority to keep the administration from revoking “a discretionary policy of nonenforcement that is sanctioning an ongoing violation of federal immigration law by nearly 700,000 aliens.”

He added: “At best, DACA is legally questionable; at worst, it is illegal.”

It might seem logical that a program implemented by one president, Obama, could be rescinded by another, Trump. But California Attorney General Xavier Becerra (D), who is leading one of the lawsuits against DACA’s revocation, said that the administration’s argument ignores an important difference.

“President Obama followed the law to put it in place,” Becerra said in interview. “Donald Trump did it the Donald Trump way. You can’t change the law by breaking the law.”

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.

In their book “Border Wars: Inside Trump’s Assault on Immigration,” New York Times reporters Julie Hirschfeld Davis and Michael D. Shear describe tense White House meetings between immigration hard-liners such as Sessions and Trump aide Stephen Miller on one side, and others such as Elaine C. Duke, then the acting homeland security secretary, on the other.

Duke relented under pressure, the authors said, but refused to cite policy objections in her short memo saying the administration was winding down the program. Instead, she relied solely on the fact that Sessions had said the program was unlawful.

That has put the Trump administration in an unusual position. Instead of arguing broad executive power over immigration, as it and other administrations have in the past, it has said the program was halted because it was probably unconstitutional.

Washington lawyer Andrew Pincus, who wrote an amicus brief on behalf of DACA recipients, said in a blog post that “such a ‘law made us do it’ rationale let the President avoid political accountability for ending an extremely popular program.”

It has proven unpersuasive to the lower courts, which have said the administration must provide other reasons.

That was at the heart of the ruling from the U.S. Court of Appeals for the 9th Circuit.

“To be clear: we do not hold that DACA could not be rescinded as an exercise of Executive Branch discretion,” Judge Kim McLane Wardlaw wrote. “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.”

Theodore B. Olsen, a solicitor general under President George W. Bush who will be one of two lawyers arguing against DACA’s recision, suggested that the Trump administration’s justification falls short of what Roberts demanded in the census case.

“An administration may impose new or different priorities, but only if it adheres to [legal] requirements and clearly states its policy choices so that it can be held publicly accountable for them,” Olson wrote.

“The judiciary, in turn, has a limited but essential role: ensuring that the executive considers and clearly explains the consequences of new approaches, especially for those who will be profoundly affected by a change.”

The consolidated cases the court will hear Tuesday are Department of Homeland Security v. Regents of the University of California, Trump v. NAACP and McAleenan v. Vidal.