President Donald Trump on Tuesday scrapped a program that protects from deportation almost 800,000 young men and women who were brought into the United States illegally as children, ordering a phased-out dismantling that gives a gridlocked Congress six months to decide the immigrants’ fate.

Trump’s action, announced by Attorney General Jeff Sessions, rescinds a program called Deferred Action for Childhood Arrivals (DACA). The administration presented the move as necessary to show respect for the country’s immigration laws, and said nobody covered by the program would be affected before March 5.

The program, created by Democratic former President Barack Obama, is supported by Democrats and many business leaders, and hundreds of people protested outside the White House over Tuesday’s announcement. Democrats and civil liberties advocates blasted Trump.

“President Trump’s decision to end DACA is a deeply shameful act of political cowardice and a despicable assault on innocent young people in communities across America,” said Nancy Pelosi, the top Democrat in the House of Representatives.

Sessions said the action does not mean the DACA recipients are “bad people.”

“To have a lawful system of immigration that serves the national interest, we cannot admit everyone who would like to come here. It’s just that simple. That would be an open-border policy and the American people have rightly rejected that,” Sessions said.

In a statement issued by the White House, Trump said, “I do not favor punishing children, most of whom are now adults, for the actions of their parents. But we must also recognize that we are nation of opportunity because we are a nation of laws.”

The move to end DACA marked the latest action by Trump that is sure to alienate Hispanic Americans, a growing segment of the U.S. population and an increasingly important voting bloc. Most of the immigrants protected by DACA, dubbed “Dreamers,” came from Mexico and other Latin American countries.

Trump’s order, deferring the actual end of the program, effectively kicks responsibility for the fate of the Dreamers to his fellow Republicans who control Congress.

But Congress has been unable since the president took office in January to pass any major legislation and has been bitterly divided over immigration in the past.

Obama bypassed Congress and created DACA through an executive order in 2012. Sessions said the Trump administration concluded that Obama exceeded his authority in setting up the program, which has long been the target of conservative hard-liners on the issue of immigration.

Elaine Duke, acting head of the Homeland Security Department, issued a memo rescinding DACA. The department will provide a limited window - until Oct. 5 - for some DACA recipients whose work permits expire before March 5 to apply to renew those permits. This would mean that some beneficiaries of DACA could be in the country through 2019.

DACA recipients whose work permits expire will be considered to be in the country and eligible for deportation, but will be a low priority for immigration enforcement, administration officials said.

Trump appeared determined to pressure U.S. lawmakers to act. “Congress, get ready to do your job - DACA!” the president wrote on Twitter on Tuesday morning before the policy announcement was made.

There were some signs that Congress might be willing to act, with a number of senior Republican lawmakers coming forward to express an interest in protecting the Dreamers.

The president’s decision may have been forced by nine Republican state attorneys general, led by Texas, who had threatened a legal challenge in federal court if Trump did not act to end DACA. A number of Democratic state attorneys general have threatened legal action to defend the program.

House of Representatives Speaker Paul Ryan called on lawmakers to find a long-term solution for the young people affected by the reversal of the program.

“At the heart of this issue are young people who came to this country through no fault of their own, and for many of them it’s the only country they know. Their status is one of many immigration issues, such as border security and interior enforcement, which Congress has failed to adequately address over the years,” Ryan said.

Trump made a crackdown on illegal immigrants a centerpiece of his 2016 election campaign and his administration has stepped up immigration arrests. But business leaders say immigrants make important economic contributions and that ending the DACA program would hit economic growth and tax revenue.

There are deep divisions in the United States over the fate of roughly 11 million illegal immigrants, most of them Hispanics. As a presidential candidate Trump promised to deport all of them.

He left the DACA announcement to Sessions, with whom the president has had tensions arising from the investigation into potential collusion between his presidential campaign and Russia.

“We are people of compassion and we are people of law. But there is nothing compassionate about the failure to enforce immigration law,” Sessions said.

DACA was created by Obama after the Republican-led Congress failed to pass comprehensive bipartisan immigration reform legislation that would have created a pathway for citizenship for certain illegal immigrants.

The program protects nearly 800,000 young men and women from deportation and allows them to work in the United States legally. The group is a small fraction of the overall population of illegal immigrants in the United States.

DACA supporters argue that the people covered under the program were raised and educated in the United States and were integrated into American society, with scant ties to their countries of origin. Opponents of the program argue against amnesty for illegal immigrants and say that such immigrants take jobs from U.S. citizens.

The program’s demise would mark the latest action by Trump to erase key parts of his Democratic predecessor’s legacy.

Get the Monitor Stories you care about delivered to your inbox. By signing up, you agree to our Privacy Policy

This includes pulling the United States out of the Paris climate accord, abandoning a 12-nation Pacific trade deal, seeking to dismantle the Obamacare healthcare law, rolling back environmental protections, reversing parts of Obama’s opening to Cuba and removing protections for transgender people.

Reporting by Steve Holland; Additional reporting by Makini Brice; Writing by Will Dunham; Editing by Tim Ahmann, Leslie Adler and Frances Kerry