WASHINGTON – President Trump on Tuesday began winding down an Obama-era immigration program designed to protect undocumented immigrants who were brought into the United States as children, but invited Congress to preserve it through legislation within six months.

"I do not favor punishing children, most of whom are now adults, for the actions of their parents," Trump said Tuesday in a written statement. Still, he added, "we must also recognize that we are nation of opportunity because we are a nation of laws."

Trump insisted Congress should be responsible for immigration policy. "The legislative branch, not the executive branch, writes these laws," he said.

Speaking later with reporters, Trump said he has "a great heart" for those involved in the Deferred Action for Childhood Arrivals program and said "hopefully now Congress will be able to help them and do it properly."

More:DACA fix could 'overwhelm' Congress that has failed to devise an immigration solution

The Department of Homeland Security will immediately stop accepting applications to the DACA program – but current recipients would not be affected until March 5 of next year. This gives Congress time to find a legislative solution to replace the program, which currently shields some 800,000 young immigrants from deportation.

Yet many lawmakers are already questioning whether Congress, already bogged down on health care and tax reform among other issues, will be able to pass a hot-button immigration bill before March. And either way, the courts are also expected to be involved in resolving the dispute over DACA.

Announcing that the U.S. would rescind the 2012 order that created the DACA program, Attorney General Jeff Sessions called the protections provided by former President Barack Obama an "unconstitutional exercise of authority by the executive branch."

Providing "amnesty" for young undocumented immigrants, Sessions said, meant "aliens" took jobs from Americans. It also contributed to a surge of unaccompanied minors on the southern border that yielded terrible humanitarian consequences, he added.

"To have a lawful system of immigration that serves the national interest, we cannot admit everyone who would like to come here," Sessions said. "It's just that simple."

Obama, in a Facebook posting criticizing Trump's decision, described the policy's reversal as wrong, self-defeating, and "cruel."

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

Obama also noted that Congress couldn't agree on an immigration plan during his presidency, so he acted "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."

More:

Obama on Trump's DACA decision: 'To target these young people is wrong'

White House spokeswoman Sarah Sanders said Tuesday the announcement came today due to deadlines from a group of Republican attorneys general from 10 states, who threatened to file a lawsuit against the DACA program if Trump didn't end it.

Rather than risk a judicial decision suddenly ending DACA, Sanders said, Trump authorized an "orderly wind down" and placed the responsibility for immigration back where it belongs: Congress.

“We have confidence that Congress is going to step up and do its job," she said.

Yet attorneys for undocumented immigrants involved in the program have also threatened lawsuits if DACA ends – and the state attorneys general of New York and Washington have vowed to challenge the administration's action in court.

"DREAMers are Americans in every way," New York Attorney General Eric Schneiderman said Tuesday, adding that more than 40,000 New Yorkers are shielded under current DACA protections. "They played by the rules; they pay their taxes; and they've earned the right to stay in the only home they have ever known."

Schneiderman, Washington Attorney General Bob Ferguson and other attorneys general were expected to join forces to mount a legal challenge.

“We have been working closely with legal teams around the country, and we expect to be joined by other states in this action," Ferguson said in a statement Monday night. “I will use all the legal tools at my disposal to defend the thousands of DREAMers in Washington state."

The American Civil Liberties Union, which has also pledged to defend DACA in court, accused Trump of "manufacturing a crisis."

"Today is a cruel day for dreamers, our families and all Americans," said Lorella Praeli, the ACLU's director of immigration policy and campaigns.

"There is no humane way to end DACA before having a permanent legislative fix in place. President Trump just threw the lives and futures of 800,000 dreamers and their families, including my own, into fearful disarray."

Related:

Hispanic Chamber CEO resigns from Trump's diversity council over DACA decision

According to a statement from the department of Homeland Security, immigrants with DACA permits that expire before March 5 can apply for a two-year renewal, but must do so before Oct. 5.

The Department of Homeland Security reports that 201,678 enrollees are set to see their protections expire in calendar year 2017; another 275,344 are set for expiration during the entire year of 2018.

Their fates remain uncertain.

Even if Congress does not take action by next March, officials said there is no guarantee that DACA members will be deported – the priority will continue to be on undocumented migrants who have committed crimes.

In his statement, Trump said, "I have advised the Department of Homeland Security that DACA recipients are not enforcement priorities unless they are criminals, are involved in criminal activity, or are members of a gang."

Trump's announcement quickly drew scorn from Democratic lawmakers and even some Republicans who accused Trump of seeking to get rid of hundreds of thousands of immigrants who contribute to the U.S. economy, and were brought into the country as children.

Sen. Martin Heinrich, D-N.M., called Trump's decision "a heartless and grave mistake. We should never be a country that kicks out some of our best and brightest students."

And Arizona Republican Sen. John McCain called rescinding DACA "the wrong approach to immigration policy at a time when both sides of the aisle need to come together to reform our broken immigration system." McCain added that children "who were illegally brought into this country through no fault of their own should not be forced to return to a country they do not know."

While some Republicans had cautioned against tasking Congress with a major immigration push considering its already crowded legislative agenda, congressional leaders said they would take action.

House Speaker Paul Ryan, R-Wis., who described DACA as well-intentioned but an abuse of executive authority, said Congress needs to address "a permanent legislative solution that includes ensuring that those who have done nothing wrong can still contribute as a valued part of this great country.”

American business leaders also objected to Trump's immigration moves.

Tim Cook, the CEO of Apple, tweeted that "250 of my Apple coworkers are #Dreamers. I stand with them. They deserve our respect as equals and a solution rooted in American values."

The U.S. Chamber of Commerce also objected, saying that cutting off hundreds of thousands of young people from employment eligibility "runs contrary to the president’s goal of growing the U.S. economy."

Yet organizations that say loose immigration policies have undercut the wages of working Americans applauded Trump's move.

Roy Beck, president of NumbersUSA, an organization that seeks to reduce immigration to the U.S., said Congress needs "to focus on strong immigration enforcement measures and reforms to our legal immigration system that put American workers first."