Donald Trump has been slammed as "cruel and wrong" by his predecessor Barack Obama.
In a rare public intervention since he left the White House, Mr Obama took issue with Mr Trump over his rescinding of an amnesty for 800,000 people brought to the United States illegally as children, who have become known as the "Dreamers".
Mr Obama, who first established the amnesty, said: "This is about young people who grew up in America. These Dreamers are Americans in their hearts, in their minds, in every way apart from on paper.
"To target these young people is wrong because they have done nothing wrong. It is self-defeating because they want to start new businesses, staff our labs, serve in our military, and otherwise contribute to the country we love. And it is cruel.
"Ultimately, this is about basic decency. It's about who we are as a people and who we want to be."
In a lengthy statement Mr Obama added: "They are that pitcher on our kid's softball team, that first responder who helps the community after a disaster, that cadet who wants nothing more than to wear the uniform of the country that gave him a chance.
"Kicking them out won't lower the unemployment rate, or lighten anyone else's taxes, or raise anybody's wages."
He called on Congress to protect the Dreamers "with a sense of moral urgency".
Mr Obama also said the decision was "contrary to our spirit, and to common sense".
The Deferred Action for Childhood Arrivals programme, known as DACA, was introduced by Mr Obama in 2012.
It allowed people who arrived illegally in the US when they were under 16, and have no criminal record, to legally study and work. Their deferral from deportation was renewed every two years.
Mr Trump later took a swipe at Mr Obama on Twitter as he declared the matter to be in the hands in Congress.
"Congress now has 6 months to legalize DACA (something the Obama Administration was unable to do). If they can't, I will revisit this issue!" he said.
Congress now has 6 months to legalize DACA (something the Obama Administration was unable to do). If they can't, I will revisit this issue!
— Donald J. Trump (@realDonaldTrump) September 6, 2017
Many of the "Dreamers" have, since arriving illegally in the Us as children, been to university, obtained high level qualifications and jobs.
The rescinding of their protection under DACA was announced by Jeff Sessions, Mr Trump's Attorney General.
Mr Sessions said: "We are people of compassion and people of law but there is nothing compassionate about failing to enforce immigration law.
"Failing to do so in the past has put our nation at risk. The compassionate thing to do is enforce the law."
He said DACA had denied jobs to Americans workers because "illegal aliens took those jobs".
Congress, get ready to do your job - DACA!
— Donald J. Trump (@realDonaldTrump) September 5, 2017
Mr Sessions said it had been an "open-ended circumvention of immigration law" and was executive overreach by the previous administration.
Homeland Security Acting Secretary Elaine Duke said the programme would be wound down over six months, which was the "least disruptive option".
It will allow Congress six months to find a legislative compromise to the situation, although Republicans in Congress are bitterly divided over the issue.
Duke said no people currently affected by DACA will be affected before March 5 next year. She added: "No new initial requests or associated applications filed after today will be acted on."