WASHINGTON — President Barack Obama will leave 8,400 U.S. troops in Afghanistan through the end of his presidency, he said Wednesday, an admission that he will fall short of a more significant reduction that was a cornerstone of his pledge to extract the U.S. from foreign ground wars.

Obama had announced in 2014 that he would cut the current level of just under 10,000 troops to 5,500 by the end of this year, but he was forced to back off from that goal as Taliban fighters run roughshod over impaired Afghan forces, launching attacks on civilian and NATO-coalition military targets and seizing land.

“The security situation in Afghanistan remains precarious,” Obama said from the White House’s Roosevelt Room. “Even as they improve, Afghan security forces are still not as strong as they need to be.”

Still, the president vowed that the U.S. role would center on training and advising Afghan troops, and he emphasized the military’s shrunken footprint in Afghanistan, down from a high of more than 100,000 troops early in his administration.

“Even as we’ve maintained a relentless case against those who are threatening us, we are no longer engaged in a major ground war in Afghanistan,” Obama said.

But his announcement reflected his limited ability to influence the sobering reality in Afghanistan after he declared an end to U.S. combat there in 2014. Afghan forces, riddled with complacency and corruption since their inception and taking orders from a fragile and fractured government, fight with Soviet-era equipment and lack intelligence-gathering and air power capabilities to ward off attacks. The Taliban controls more territory than it has since the U.S.-led invasion there began in 2001, according to U.N. estimates. The economy in the country, already one of the world’s poorest, has suffered as the tens of thousands of U.S. troops and the sprawling infrastructure sustaining them has begun to disappear.

“Afghanistan is not a perfect place,” Obama said. “Given the enormous challenges they face, the Afghan people will need the partnership of the world — led by the United States — for many years to come.”

Obama promised two years ago to eventually reduce the U.S. presence in Afghanistan to merely “a normal embassy presence in Kabul, with a security assistance component” by the start of next year. But with counterterrorism efforts faltering in the country, Obama said he concluded that cutting troop levels in half in service of that goal would be irresponsible.

For years, Obama had fought such a concession against pressure from military leaders. Pentagon officials, haunted by the chaos in Iraq after Obama’s decision to disengage the U.S. military there, were concerned that a speedy withdrawal in Afghanistan would create more instability.

The total of 8,400 troops reflects the assessment of Afghanistan submitted last month to Obama by Army Gen. John W. Nicholson Jr., the new commander for U.S. and NATO forces in the country, a Defense Department official said in a background call with reporters. The U.S. role in southwest Asia and the Middle East as a whole is undergoing a shift, from securing volatile areas to supporting local forces in their effort to do so.

Sen. John McCain, R-Arizona, chairman of the Senate Armed Services Committee, welcomed Obama’s decision but had reservations.

“When the president himself describes the security situation in Afghanistan as ‘precarious,’ it is difficult to discern any strategic rationale for withdrawing 1,400 U.S. troops by the end of the year,” he said.

Indeed, battles with the Taliban last year revealed glaring weaknesses in Afghan security forces, and U.S. special operations troops still accompany Afghan forces on combat missions, while fighter jets and drones provide air support to ground troops. In May, the U.S. killed Taliban leader Mullah Akhtar Mohammad Mansour southwest of the remote town of Ahmad Wal, in western Pakistan, in a drone strike authorized by Obama.

But one U.S. air attack mistakenly hit an international hospital in Kunduz in October, killing 42 medical workers, patients and other Afghans and wounding dozens more.

And the Taliban has stepped up the fight across southern Helmand, Kandahar and Uruzgan provinces and directed suicide bombings inside populated cities. Last week, more than 30 Afghans were killed when two suicide bombers attacked a convoy of buses carrying newly graduated police officers who were traveling to Kabul from a training center in neighboring Wardak province.

The Pentagon set the stage for Obama’s announcement last month when it reported changes to rules that restricted airstrikes against Taliban targets, a signal that military leaders had concluded that troop numbers needed to remain constant. The Taliban will continue to threaten southern Afghanistan from its stronghold in Helmand province as the summer fighting season goes on, Army Brig. Gen. Charles Cleveland, a spokesman for the U.S.-led coalition in Kabul, warned last month.

Obama is set to leave Washington on Thursday for a summit in Poland with fellow NATO leaders to reassess their strategy in Afghanistan and the Middle East.

Distributed by Tribune Content Agency, LLC.