President Trump tweeted Friday he would be open to a deal with Congress to protect some 700,000 undocumented U.S. residents who came to the United States as children if the U.S. Supreme Court strikes down the Deferred Action for Childhood Arrivals policy instituted by his predecessor.

DACA allows so-called Dreamers to live and work in the United States without fear of deportation. The policy was established in an executive order by President Obama but Trump rescinded the document when he came into office in 2017.

Reacting to comments by Christopher Hajec of the Immigration Law Institute, who said the high court needs to determine whether DACA is lawful rather than just whether Trump’s decision to end the program is legal, Trump called DACA illegal and that Obama knew it was illegal when he signed the order.

“[It] looks very odd that President Trump doesn’t have the discretion to end the program that President Obama began in his discretion,” Trump quoted Hajec as saying.

“Rest assured that if the SC [Supreme Court] does what all say it must, based on the law, a bipartisan deal will be made to the benefit of all,” Trump tweeted. Congress has failed to act on the issue in the past.

The Supreme Court agreed to hear the DACA case in June and is expected to rule by next June.

Three district courts and two appeals courts have ruled against the administration. In a brief filed before the Supreme Court late last month, Solicitor General Noel Francisco argued DACA “is legally questionable; at worst, it is illegal.”

"These cases concern the executive branch’s authority to revoke a discretionary policy of nonenforcement that is sanctioning an ongoing violation of federal immigration law by nearly 700,000 aliens," Francisco wrote. President Todd Schulte told The Hill DACA has been “incredibly successful” and urged the Supreme Court to reject the administration action. He said Francisco’s argument “makes clear that the administration continues to take every step possible to rip protections away from DACA recipients who know no other home than the United States. Federal courts across the country have repeatedly made clear that the Trump administration’s termination of DACA was unlawful."

Oral arguments are scheduled for November.