By JILL COLVIN and SADIE GURMAN, Associated Press

WASHINGTON (AP) – President Donald Trump on Tuesday began dismantling the government program protecting hundreds of thousands of young immigrants who were brought into the country illegally as children. Attorney General Jeff Sessions declared the Obama administration's program "an unconstitutional exercise of authority" that must be revoked.

New applications will be halted for President Barack Obama's Deferred Action for Childhood Arrivals program, which has provided nearly 800,000 young immigrants a reprieve from deportation and the ability to work legally in the U.S. in the form of two-year, renewable work permits.

"I'm here today to announce that the program known as DACA that was effectuated under the Obama administration is being rescinded," Sessions announced.

But the administration is giving Congress six months to come up with a legislative fix – "should it choose to," Sessions said – before the government stops renewing permits for people already covered by the program.

According to Department of Homeland Security officials, people with permits whose renewals are set to expire between now and March 5, 2018, will be able to re-apply – so long as their applications are submitted by Oct. 5, 2017, one month from Tuesday. No permits will be revoked before their existing expiration dates, and applications already in the pipeline will be processed, they said.

Trump, in a statement, said the change would be "a gradual process, not a sudden phase out."

"Thus, in effect, I am not going to just cut DACA off, but rather provide a window of opportunity for Congress to finally act," he said. He said he did not favor punishing children for the actions of their parents. At the same time, though, "we must also recognize that we are a nation of opportunity because we are a nation of law" and "young Americans have dreams, too."

His action drew swift criticism from many immigration advocates and Democratic lawmakers.

House Democratic leader Nancy Pelosi called Trump's decision "a deeply shameful act of political cowardice and a despicable assault on innocent young people in communities across America."

Some Republicans objected, too.

Sen. John McCain of Arizona said Trump was taking "the wrong approach," and he added: "The federal government has a responsibility to defend and secure our borders, but we must do so in a way that upholds all that is decent and exceptional about our nation."

Trump's announcement came the same day as a deadline set by a group of Republican state officials who said they would challenge DACA in court unless the Trump administration rescinded the program. Administration officials argued the program might not hold up in court – and said that allowing the lawsuit to proceed would throw the program into far more chaos than the move they chose.

White House spokeswoman Sarah Huckabee Sanders said the president had been given a choice between the "likely sudden cancellation of the program by a judge" or "an orderly wind-down that preserved the rule of law," and made the best decision in light of those options.

Trump has spent months wrestling with what to do with DACA, which he slammed during his campaign as illegal "amnesty." Many of his closest advisers, including Sessions, policy adviser Stephen Miller, and former chief strategist Steve Bannon argue that the program is unconstitutional and have urged Trump to follow through on his campaign promise to end it.

But Trump has repeatedly expressed sympathy for the young people protected by the program.

"I think the Dreamers are terrific," Trump said last week, using a term popularized by supporters of the program, which was created in 2012 as a stopgap as the Obama administration pushed unsuccessfully for a broader immigration overhaul in Congress.

His approach – essentially kicking the can down the road and letting Congress deal with it– is fraught with potential peril for his own party. Trump's decision to take a harder line on young immigrants unless Congress intervenes threatens to emphasize deep divisions among Republicans who have long struggled with the issue.

House Speaker Paul Ryan said in a statement he hoped the "House and Senate, with the president's leadership, will be able to find consensus on 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."

"Congress writes laws, not the president, and ending this program fulfills a promise that President Trump made to restore the proper role of the executive and legislative branches. But now there is more to do, and the president has called on Congress to act," he said.

But Congress has repeatedly tried – and failed – to come together on immigration overhaul legislation, and it remains uncertain whether the House would succeed in passing anything on the divisive topic.

Sanders, however, dismissed concerns that Congress would not be able to act and said the president was looking to sign "responsible immigration reform," not just a bill legalizing Dreamers' status.

"If they can't, then they should get out of the way and let somebody else take their job that can actually get something done," she said.

Florida Republican Sen. Marco Rubio appealed to the White House for more clarity about what Trump is willing to sign.

"Congress now has less than six months to deal with this the right way, through the legislative process," he said, adding: "We have no time to waste on ideas that do not have the votes to pass or that the president won't sign."

Trump's expected move has sparked protests, phone banks, letter-writing campaigns and other efforts across the country urging him not to act.

Mario H. Lopez, the president of the conservative Hispanic Leadership Fund, said that while he disagreed with the way Obama went about DACA, he worried that six months wasn't enough to come up with a better plan.

"It just doesn't seem like there's a great window to get this done, and we're concerned that the president didn't really commit to any kind of Dream Act," he said. "He just sort of dropped it in Congress' lap."