The future of the DACA program for young illegal immigrants remained uncertain as the Supreme Court on Tuesday appeared to lack consensus on whether the Trump administration's plans to rescind legal protections for so-called Dreamers were proper.

The cases were debated during 80 minutes of tense oral arguments. No side appeared to command a clear majority of justices over what has become a major test of executive power on the contentious issue of immigration reform. A ruling from the high court is expected in June, in the midst of the 2020 presidential campaign.

TRUMP OPENS DOOR TO DACA 'DEAL' IF SUPREME COURT RULES HIS WAY IN LANDMARK CASE

At issue is the Obama-era program known as the Deferred Action for Childhood Arrivals, or DACA. It was created under executive order and gives about 700,000 people brought as children to the United States illegally --or on visas that later were overstayed -- the opportunity to receive a renewable two-year period of deferred action from deportation and become eligible for a work permit.

Hundreds of Dreamers and their supporters rallied outside the court. Some carried signs, such as "Build Bridges, Not Walls." Members of Congress were among those watching the arguments inside.

President Trump tweeted earlier Tuesday morning that if the administration prevails at the high court, he promised "a deal will be made with the Dems for them to stay!"

Justice Sonia Sotomayor pointedly faulted Trump, asking whether the administration took into full account the harm she said winding down DACA would do, calling what the president did a "choice to destroy lives."

"The current president [was] telling DACA-eligible people that they were safe under him and that he would find a way to keep them here," she said. "And so he hasn't and, instead, he's done this."

But several conservative justices questioned whether courts should be second-guessing the discretionary power of federal agencies.

"You would agree the executive has the authority to rescind DACA?" asked Justice Brett Kavanaugh.

The lawyer for groups supporting the program admitted that was correct, but said federal law also required the government to give a "reasoned explanation" and orderly process for its policy decisions, which lower courts found were not done.

CLICK HERE TO GET THE FOX NEWS APP

One thing the nine-member bench seemed to agree, as Justice Stephen Breyer explained, is that "Everyone is struggling," trying to decide the case. "What's the line?" over preserving the competing interests, Breyer asked.

The Trump administration announced its plan to phase out the program in 2017, only for the federal courts to rule that it could not apply retroactively and that DACA should be restarted in full. The White House fought back on those decisions, saying the president has broad authority over immigration enforcement policy.

U.S. Solicitor General Noel Francisco told the justices the DACA program is not working and is unlawful, and that the president should have the "absolute discretion" to adopt a revised overall immigration strategy.

A dozen states led by Texas are among the parties backing the administration.

DACA proponents have argued that Trump’s planned termination violates federal law requiring adequate notice-and-comment periods before certain federal rules are changed, as well as other constitutional equal protection and due process guarantees.

They say the government has given only cursory explanations for justifying DACA's demise. By contrast, they say, the economic and social benefits for Dreamers and for the country are indisputable.

A host of civil rights groups filed separate briefs in support, along with several states including New York and California.

Most of the attention in court was focused on Chief Justice John Roberts, a conservative who has moved to the court's center on a few high-profile cases. He was the deciding vote in two recent cases of hot-button Trump policies: voting last year to uphold the so-called Muslim ban on visitor and asylum entry into the U.S.; and this past June, blocking efforts to add a citizenship question to the 2020 census.

Roberts asked nuanced, textual questions of both sides during the DACA arguments. But he suggested at one point the government had sufficient justification for ending DACA.

"If DACA was illegal, that means that when the government was giving out these benefits it was acting illegally, right?" he said. "Now it's not always the case when the government acts illegally in a way that affects other people that we go back and untangle all of the consequences of that.”

Francisco said there were several independently-sufficient reasons for the government's discretion.

"We own this," he said.

But several justices said whether legal or not, the administration has not offered independent grounds for eliminating the program.

"It leaves substantial doubt about its illegality," said Justice Ruth Bader Ginsburg.

Several on the bench lamented the other two branches have not been able to come up with a legislative solution to DACA, and a similar program for undocumented adult immigrants whose children are U.S. citizens.

The consolidated cases are DHS v. Regents of the University of California (18-587); Trump v. NAACP (18-588); McAlleenan v. Vidal (18-589). A ruling is expected by late June 2020.