President Trump suggested Friday that if he prevails in a Supreme Court case next term he would be open to a bipartisan deal in Congress on the Obama-era program that shields young undocumented immigrants brought to the country as children from deportation.

In a series of morning tweets, Trump weighed in on a case the court agreed in June to hear next term about whether his administration illegally tried to end the Deferred Action for Childhood Arrivals (DACA) program.

“DACA will be going before the Supreme Court,” Trump wrote, adding: “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!”

Since his administration’s move to scuttle the program in 2017, 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.

Democrats are likely to view Trump’s latest overture skeptically.

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

In his tweets, Trump asserted that then-President Barack Obama had “no legal right” to initiate DACA in 2012 with a presidential proclamation.

“But in any event, how can he have the right to sign and I don’t have the right to ‘unsigned,’ ” Trump wrote. “Totally illegal document which would actually give the President new powers.”

DACA has protected nearly 700,000 people brought to the United States illegally as children from deportation, a group that’s been labeled “dreamers.”

The Trump administration moved to terminate the program 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.

Robert Barnes contributed to this report.