WASHINGTON ― Former President Barack Obama said Tuesday that President Donald Trump’s decision to dismantle the program protecting young undocumented immigrants was “contrary to our spirit, and to common sense.”

Trump announced Tuesday that he will end Obama’s Deferred Action for Childhood Arrivals program, or DACA, in six months. Unless Congress steps in, ending the program could put nearly 800,000 undocumented young people at risk of deportation and unable to work legally when their two-year permits expire.

Obama said it was a “political decision, and a moral question” ― and one of basic decency.

“To target these young people is wrong ― because they have done nothing wrong,” he said in a statement. “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. 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.”

Obama started the program in 2012 and urged undocumented immigrants who came to the U.S. as children to come forward to the government, pay a fee and undergo a background check before receiving a two-year work permit and reprieve from deportation.

He did so after legislative efforts to help Dreamers ― which are being revived now because of Trump’s decisions ― failed multiple times, as he noted in his statement.

″[B]ecause 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,” Obama said.

To target hopeful young strivers who grew up here is wrong, because they’ve done nothing wrong. My statement: https://t.co/TCxZdld7L4 — Barack Obama (@BarackObama) September 5, 2017

Trump promised during his presidential campaign to immediately end DACA, but Obama urged him not to, both publicly and in private conversations. In his final press conference as president, Obama said he would speak out if Trump targeted Dreamers “who have grown up here and for all practical purposes are American kids and send them someplace else when they love this country; they are our kids’ friends and their classmates, and are now entering into community colleges or, in some cases, serving in our military.”

“The notion that we would just arbitrarily, or because of politics, punish those kids when they didn’t do anything wrong themselves I think would be something that would merit me speaking out,” Obama said at the time.

By ending DACA, Trump dismantled one of Obama’s most significant immigration policy achievements. Trump already dramatically reshaped immigration enforcement from how it was under Obama, who began his presidency with record deportation numbers before changing enforcement priorities to focus on certain undocumented immigrants over others.

Trump immediately eliminated those priorities as president and has detained and deported people whom Obama allowed to remain in the country if they checked in with the government or met other requirements.

Trump said that Congress should act on Dreamers, although his statements were vague and the only legislation he mentioned specifically during his statement on DACA focused on limiting legal immigration, not actually undocumented immigrants.

Obama said it was time for Congress to act as well.

“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,” Obama said. “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.”

Former Vice President Joe Biden, who served with Obama, similarly condemned Trump’s decision to end DACA.

″[L]et’s be clear: throwing [Dreamers] out is cruel,” Biden said in a statement. “It is inhumane. And it is not America. Congress and the American people now have an obligation to step up and show our neighbors that they’re welcome here, in the only place they’ve ever called home.”