WASHINGTON — President Trump announced Tuesday that his administration would end an Obama-era program that allowed young, undocumented immigrants to live in the country without fear of deportation, calling the program unconstitutional and challenging Congress to address the issue.

Trump’s decision, coming after weeks of intensive deliberations with aides, sparked fears among advocates that nearly 800,000 immigrants who have lived illegally in the United States since they were children would be subject to removal once their government-issued work permits expire under the Deferred Action for Childhood Arrivals program.

The president and his top advisers said they had no choice but to end DACA, framing it as an abuse of executive power from President Barack Obama that was unlikely to survive a legal challenge. They called on lawmakers to determine the ultimate fate of DACA recipients, known as “dreamers,” and emphasized that no work permits would be revoked for at least six months to give Congress time to act.

In a sign of the political sensitivities involved, Trump did not make public remarks, deferring to Attorney General Jeff Sessions to unveil the decision at the Justice Department.

In a written statement, Trump asserted that Obama made “an end-run around Congress” that violated “the core tenets that sustain our Republic.” He added that there can be “no path to principled immigration reform if the executive branch is able to rewrite or nullify federal laws at will.”

A wide array of politicians, civic leaders and business executives spoke out against Trump’s move, including the Mexican government, Facebook founder Mark Zuckerberg and the Catholic Charities of New York. Some Democrats, including New York Attorney General Eric Schneiderman, vowed to pursue legal action to protect the dreamers.

In a lengthy post on his Facebook page, Obama called Trump’s move “cruel” and said it represented a “political decision” to a “moral question.”

“Ultimately,” Obama wrote, “this is about basic decency. This is about whether we are a people who kick hopeful young strivers out of America, or whether we treat them the way we’d want our own kids to be treated. It’s about who we are as a people – and who we want to be.”

‘NOT ENFORCEMENT PRIORITIES’

Senior officials at the Department of Homeland Security said that the agency would no longer accept new applications for DACA other than those submitted before Tuesday. Immigrants enrolled in the program will be permitted to continue until their two-year work permits expire. And those whose permits expire through March 5, 2018, are allowed to seek renewals provided they do so by Oct. 5, officials said.

If Congress fails to act, dreamers would not be high deportation priorities, DHS officials said, but would be issued notices to appear at immigration court if they are encountered by federal immigration officers. There are no plans for DHS to use personal information, including home addresses, of dreamers who registered for work permits to aid in deportation operations unless there is an immediate concern over national security, officials said.

“Our enforcement priorities remain unchanged,” Trump said in his statement. “We are focused on criminals, security threats, recent border-crossers, visa overstays, and repeat violators. I have advised the Department of Homeland Security that DACA recipients are not enforcement priorities unless they are criminals, are involved in criminal activity, or are members of a gang.”

Congressional leaders from both parties said the time was right to pursue a legislative solution for the dreamers, but they did not lay out a clear path on an issue that has vexed lawmakers since President Ronald Reagan signed the last major comprehensive immigration bill in 1986. The Dream Act, which would have offered a path to citizenship to dreamers, failed narrowly in the Senate in 2010 after passing in the House.

House Speaker Paul Ryan, R-Wis., who last week had urged Trump not to end the program until Congress acted, called DACA a “clear abuse of executive authority” by Obama.

“It is my hope that the House and Senate, with the president’s leadership, will be able to find consensus on a permanent legislative solution that includes ensuring that those who have done nothing wrong can still contribute as a valued part of this great country,” Ryan said.

THREAT OF LAWSUIT FORCED MOVE

Trump had equivocated for months as pressure mounted among immigration hawks to fulfill a campaign promise to end DACA. Reflecting his personal ambivalence, he had vowed to show “great heart” in his decision and declared that dreamers could “rest easy.”

But a threat from Texas and several other states to sue the administration if it did not end DACA by Tuesday forced Trump to make a decision. Several senior aides, including Sessions, who declared that the Justice Department would be unable to defend the program in court, lobbied the president to end DACA. Others, including Chief of Staff John Kelly, the former DHS secretary, cautioned that terminating the program would cause chaos for young immigrants who enjoy broad popular support.

The Obama administration had defended the creation of the 2012 program by citing the precedent of “prosecutorial discretion” in which law enforcement agencies with limited resources set priorities to fulfill obligations. With more than 11 million immigrants in the country illegally, the government had the ability to deport only a small fraction each year, Obama aides said at the time.

Sessions wrote a memo Monday concluding that DACA is unconstitutional, prompting acting Homeland Security Secretary Elaine Duke to issue orders Tuesday to phase out the program, officials said. In his remarks, Sessions said Obama “sought to achieve specifically what the legislative branch refused to do” and that “the Department of Justice cannot defend this overreach.

Texas Attorney General Ken Paxton applauded Trump’s decision, saying DACA “went far beyond the executive branch’s legitimate authority.” Paxton said the states would lift their threat of legal action.

DACA supporters expressed skepticism that an administration that has taken a hard line on immigration would exercise restraint with dreamers once the work permits begin to expire.

More than 300 immigration activists protested front of the White House, calling Trump a “liar” and a “monster,” and more than two dozen demonstrators were reportedly arrested outside Trump Tower in New York. Javier Palomarez, president of the U.S. Hispanic Chamber of Commerce, resigned from Trump’s presidential diversity committee over the “disgraceful action.”

In a tweet, former Vice President Joe Biden wrote: “Brought by parents, these children had no choice in coming here. Now they’ll be sent to countries they’ve never known. Cruel. Not America.”

The fight over the dreamers now shifts to Congress, where several new proposals have been put forward. Those include the Bridge Act, a bipartisan bill with 25 co-sponsors that would extend DACA protections for three years to give Congress time to enact permanent legislation.