Donald Trump sparked widespread outcry when he announced a plan to scrap a programme that permitted 800,000 young people and children to remain in the country.

Among those to criticise him was Barack Obama, his predecessor in the White House and the man who had introduced the immigration scheme in 2012.

Mr Obama has been largely muted in his comments about Mr Trump since he left the White House. However, in a post on Facebook, Mr Oama said Mr Trump's actions had cast "a shadow has been cast over some of our best and brightest young people".

Read his comments here:

"Immigration can be a controversial topic. We all want safe, secure borders and a dynamic economy, and people of goodwill can have legitimate disagreements about how to fix our immigration system so that everybody plays by the rules.

"But that’s not what the action that the White House took today is about. This is about young people who grew up in America – kids who study in our schools, young adults who are starting careers, patriots who pledge allegiance to our flag. These Dreamers are Americans in their hearts, in their minds, in every single way but one: on paper. They were brought to this country by their parents, sometimes even as infants. They may not know a country besides ours. They may not even know a language besides English. They often have no idea they’re undocumented until they apply for a job, or college, or a driver’s license.

"Over the years, politicians of both parties have worked together to write legislation that would have told these young people – our young people – that if your parents brought you here as a child, if you’ve been here a certain number of years, and if you’re willing to go to college or serve in our military, then you’ll get a chance to stay and earn your citizenship. And for years while I was President, I asked Congress to send me such a bill.

All of Donald Trump's attacks on Barack Obama for playing golf

"That bill never came. And because it made no sense to expel talented, driven, patriotic young people from the only country they know solely because of the actions of their parents, my administration acted to lift the shadow of deportation from these young people, so that they could continue to contribute to our communities and our country. We did so based on the well-established legal principle of prosecutorial discretion, deployed by Democratic and Republican presidents alike, because our immigration enforcement agencies have limited resources, and it makes sense to focus those resources on those who come illegally to this country to do us harm. Deportations of criminals went up. Some 800,000 young people stepped forward, met rigorous requirements, and went through background checks. And America grew stronger as a result.

"But today, that shadow has been cast over some of our best and brightest young people once again. 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. What if our kid’s science teacher, or our friendly neighbor turns out to be a Dreamer? Where are we supposed to send her? To a country she doesn’t know or remember, with a language she may not even speak?

"Let’s be clear: the action taken today isn’t required legally. It’s a political decision, and a moral question. Whatever concerns or complaints Americans may have about immigration in general, we shouldn’t threaten the future of this group of young people who are here through no fault of their own, who pose no threat, who are not taking away anything from the rest of us. They are that pitcher on our kid’s softball team, that first responder who helps out his community after a disaster, that cadet in ROTC 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’s taxes, or raise anybody’s wages.

Barack Obama's best moments in the White House Show all 11 1 /11 Barack Obama's best moments in the White House Barack Obama's best moments in the White House May 19, 2009 “The President was leaving the State Floor after an event and found Sasha in the elevator ready to head upstairs to the private residence. He decided to ride upstairs with her before returning to the Oval Office,” Peter Souza Barack Obama's best moments in the White House Oct. 26, 2012 President Barack Obama pretends to be caught in Spider-Man's web as he greets the son of a White House staffer in the Outer Oval Office Peter Souza Barack Obama's best moments in the White House “A National Security staffer, Carlton Philadelphia, brought his family to the Oval Office for a farewell photo with President Obama. Carlton’s son, Jacob, softly told the President he had just gotten a haircut like President Obama, and asked if he could feel the President’s head to see if it felt the same as his.” Peter Souza Barack Obama's best moments in the White House March 21, 2010 The President, Vice President and senior staff applaud after watching on television the House vote on H.R. 4872 for health care reform, in the Roosevelt Room of the White House Peter Souza Barack Obama's best moments in the White House Dec. 3, 2009 President Barack Obama fist-bumps custodian Lawrence Lipscomb in the Eisenhower Executive Office Building following the opening session of the White House Forum on Jobs and Economic Growth Peter Souza Barack Obama's best moments in the White House Sept. 22, 2015 "The Obama family and Biden family greet Pope Francis as he arrives in the United States for the first time at Joint Base Andrews," Sept. 22, 2015. Peter Souza Barack Obama's best moments in the White House Feb. 21, 2014 President Barack Obama and Vice President Joe Biden participate in a "Let's Move!" video taping on the Colonnade of the White House, Feb. 21, 2014 Peter Souza Barack Obama's best moments in the White House Feb. 18, 2016 President Barack Obama watches First Lady Michelle Obama dance with 106-Year-Old Virginia McLaurin in the Blue Room of the White House prior to a reception celebrating African American History Month, Feb. 18, 2016 Peter Souza Barack Obama's best moments in the White House Jan. 21, 2013 "The President and First Lady wave to supporters as they ride in the inaugural parade. I had asked the President if I could ride in the presidential limousine and the President joked, 'But Michelle and I were planning to make out," Jan. 21, 2013. Peter Souza Barack Obama's best moments in the White House Barack Obama and former First Lady Michelle Obama share a private moment in a freight elevator at an Inaugural Ball, January 2009 all pics: Pete Souza Barack Obama's best moments in the White House Barack Obama rests his hand on the bible that President Lincoln used for his swear-in, being held by his wife Michelle Obama as he is sworn in as the 44th President of the United States of America Rex

"It is precisely because this action is contrary to our spirit, and to common sense, that business leaders, faith leaders, economists, and Americans of all political stripes called on the administration not to do what it did today. And 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. I’m heartened by those who’ve suggested that they should. And I join my voice with the majority of Americans who hope they step up and do it with a sense of moral urgency that matches the urgency these young people feel.

"Ultimately, 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.