The Pentagon is developing plans to withdraw up to half of the 14,000 American troops serving in Afghanistan, U.S. officials said Thursday, marking a sharp change in the Trump administration's policy aimed at forcing the Taliban to the peace table after more than 17 years of war.

One official said the troops could be out by summer, but no final decision has been made.

President Donald Trump has long pushed to pull troops out of Afghanistan, considering the war a lost cause. But earlier this year, he was persuaded by Defense Secretary Jim Mattis and others military leaders to keep troops on the ground to pressure the Taliban and battle a stubborn Islamic State insurgency. Officials said the latest White House push for withdrawal was another key factor in Mattis' decision to resign Thursday.

The officials spoke on condition of anonymity to discuss internal deliberations.

U.S. troops stormed into Afghanistan in November 2001 in an invasion triggered by the Sept. 11 attacks.

Since then, America has lost more than 2,400 soldiers and spent more than $900 billion in its longest war. Three U.S. presidents have pledged to bring peace to Afghanistan, either by adding or withdrawing troops, by engaging the Taliban or shunning them, and by struggling to combat widespread corruption in the government.

The U.S. and NATO formally concluded their combat mission in 2014, but American and allied troops remain, conducting strikes on the Islamic State group and the Taliban and working to train and build the Afghan military.

Taliban insurgents, however, control nearly half of Afghanistan and are more powerful than at any time since a 2001 U.S.-led invasion. They carry out near-daily attacks, mainly targeting security forces and government officials.

In recent months, however, there has been a renewed effort to make progress on peace talks with the Taliban. Officials now worry that any move to withdraw U.S. troops this year could dampen those prospects and simply encourage the Taliban to wait it out until they can take advantage of the gaps when the forces leave.