Image copyright AFP Image caption Protesters gathered outside the US embassy in Mexico City

An Obama-era scheme to protect young undocumented immigrants is being scrapped, US Attorney General Jeff Sessions has announced.

No first-time applications for the Deferred Action for Childhood Arrivals (Daca) programme will be acted on after Tuesday, the government confirmed.

However, existing recipients will not be affected for at least six months.

Barack Obama described the decision of the Trump administration as "cruel" and "wrong", and appealed to Congress.

The scheme protected some 800,000 so-called "Dreamers", mostly Latin Americans, from deportation.

They were able to apply for work and study permits under a policy which, critics said, amounted to an amnesty for illegal immigrants.

Media playback is unsupported on your device Media caption Harvey hero now faces Daca deportation

US President Donald Trump took a hard line on immigration while campaigning for office last year and said he planned to "immediately terminate" Daca if elected.

In a statement after Daca was rescinded, he said, "I do not favour punishing children, most of whom are now adults, for the actions of their parents. But we must also recognise that we are nation of opportunity because we are a nation of laws."

The Mexican government said in a statement (in Spanish) that it profoundly regretted the scrapping of Daca and would step up its consular work on behalf of its citizens who are affected.

Image copyright AFP Image caption Demonstrators marched in Los Angeles

Those returning to Mexico would be welcomed back "with open arms", it said.

Police in New York made at least a dozen arrests when protesters rallied in front of Trump Tower, US media report, but there were no reports of clashes.

Trump switches the pressure

By Anthony Zurcher, BBC News, Washington

Candidate Trump promised to do away with Daca, despite warnings from a cross-party collection of politicians. Or, knowing this president, objections from "the establishment" only make him more determined to act.

Fortunately for him, unlike repealing Obamacare or building his Mexican border wall, he does not need Congress's help here.

In fact, by setting a six-month fuse on the effects of Daca's termination - and stretching the impact out over the next two years as work permits expire - Mr Trump puts all the pressure on legislators.

It will not be easy for Daca supporters in Congress. They will have to get legislation passed over the objection of immigration hawks in the House. It may also need 60 votes in the Senate to break a filibuster - from the right or even the left, if the bill is packaged with hardline immigration measures. What is more, Congress already has its hands full with other pressing issues - hurricane relief, budget resolutions, the need to authorise new government debt and, at some point, tax reform.

If Congress fails to act, Republicans with tough re-election races will be in a difficult spot, facing angry constituents just as the campaign season gets into gear.

The president, however, satisfies his anti-immigration base with this move - and washes his hands of the matter. The loyalists who have stood by him are rewarded, others in his party be damned.

What is Daca?

The programme protects young illegal immigrants in the US from deportation and provides temporary permits for work and study.

In order to qualify for Daca, applicants under the age of 30 submitted personal information to the Department of Homeland Security (DHS).

Media playback is unsupported on your device Media caption Where do America's undocumented immigrants live?

They had to go through an FBI background check and have a clean criminal record, and either be in school, recently graduated or have been honourably discharged from the military.

In exchange, the US government agreed to "defer" any action on their immigration status for a period of two years.

How did Sessions justify scrapping it?

In a stinging attack on the policy introduced by President Obama, Mr Sessions said: "Such an open-ended circumvention of immigration laws was an unconstitutional exercise of authority by the executive branch.

Image copyright Getty Images

"The effect of this unilateral executive amnesty among other things contributed to a surge of minors at the southern border that yielded terrible humanitarian consequences. It also denied jobs to hundreds of thousands of Americans by allowing those same illegal aliens to take those jobs.

"The nation must set a limit on how many immigrants we admit each year. We cannot admit everyone who would like to come here, it's just that simple."

In his statement, President Trump pointed out that his predecessor, Mr Obama, had bypassed Congress to introduce the policy, which was announced in June 2012.

"There can be no path to principled immigration reform if the executive branch is able to rewrite or nullify federal laws at will," Mr Trump said.

White House spokesperson Sarah Sanders said later that the president had "wrestled... back and forth" with the issue because he wanted to "make a decision with compassion".

"But at the same time you can't allow emotion to govern and this has to be something where the law is put in place and it's something that he would support if Congress puts it before him," she added.

How does this affect current 'Dreamers'?

No new first-time requests will be acted on after 5 September, DHS Acting Secretary Elaine Duke said in a memo released after Mr Sessions spoke.

However, no existing beneficiaries of the policy will feel any impact for six months, the period of time allotted for Congress to "deliver on appropriate legislative solutions".

People who have current Daca work authorisation will be able to keep it until it expires while people whose permits expire in less than six months can renew before 1 October for another full two years.

What did Obama say?

Mr Obama wrote on Facebook: "To target these young people is wrong - because they have done nothing wrong."

"Ultimately, this is about basic decency," he said. "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."

Despite bypassing Congress himself while in office, the former president said, "Now that the White House has shifted its responsibility for these young people to Congress, it's up to Members of Congress to protect these young people and our future."

Image copyright Reuters Image caption Protests against the scrapping of the scheme continued on Tuesday in Washington

US House Democratic leader Nancy Pelosi also slammed Tuesday's decision, describing it as a "cruel act of political cowardice".

In a statement, she called on majority Republicans in Congress to join Democrats in immediately moving to safeguard Daca recipients.

Amber Pinto, who works for immigrant activist group United We Dream, was amongst those who gathered outside the White House to demonstrate against the decision on Tuesday.

"I'm undocumented, unafraid and here to stay," he said to applause.

"I have the honour to serve as a deportation defence hotline manager for United We Dream, where every day my team and I get to hear stories from our communities on how their loved ones are being criminalised by law enforcement and terrorised by immigration agents."