Wooden B huts sit ready to be dismantled while newer, more permanent buildings can be seen in the background at Bagram Air Field, Afghanistan, on Sept. 18, 2014. Engineers are putting up new buildings to host troops for at least the next 2 years.

WASHINGTON — The Obama administration plans to keep hundreds of extra troops in Afghanistan on a temporary basis next year, above the force of 9,800 that President Barack Obama had previously announced for 2015, in another sign of the challenges the United States faces as it extricates itself from a 13-year war.

U.S. officials, speaking on condition of anonymity to discuss military planning, said the Obama administration was continuing its discussions with allied nations about how many troops NATO countries would be able to contribute to a training mission in Afghanistan, set to begin on Jan. 1 when the alliance’s long combat mission ends.

The date is a milestone as the United States and other Western nations seek to curtail their military involvement in Afghanistan without allowing the Afghan government to cede ground to the Taliban, which has intensified its attacks in the capital in recent weeks.

But because not all NATO nations are able to meet targets for contributing troops to the 12,000-strong training force by Jan. 1, the United States will keep a larger number of troops in Afghanistan, at least until the early spring, the officials said.

"All this is keeping the lights turned on until partner nations can get their people (in place)," a U.S. official said.

After a lengthy internal debate, the White House unveiled a plan in May to reduce the U.S. force in Afghanistan to 9,800 service members by Jan. 1, 2015, a step toward ending its military presence entirely by the time Obama leaves office in 2017. While most of those troops will take part in the NATO mission to support Afghanistan’s military, others will be assigned to a separate counter-terrorism mission focused on al-Qaida.

U.S. officials said the need for a ’bridging solution’ resulted from a long delay in finalizing security agreements required to keep foreign troops in Afghanistan after 2014. Officials described the decision as a stop-gap measure to ensure the NATO training mission can be launched as planned.

The evolving plans for the future U.S. military force in Afghanistan follows Obama’s recent decision to expand authorities for U.S. troops to protect Afghan soldiers and respond to militant attacks beyond this year.

Both steps indicate the difficulty of restricting the U.S. military role in Afghanistan while the country’s fragile national unity government remains dependent on the West for air support and other key military activities. Afghanistan will also require billions of dollars of outside aid to fund its own military for years to come.

Plans for the bridging solution were first reported by Reuters in November, but officials at the Pentagon had declined to confirm those plans.

Washington Post staff writer Karen DeYoung contributed to this report.

