An Afghan National Army commando stands guard as soldiers parade during a graduation ceremony in Kabul, November 23, 2014. The Afghan parliament had approved military agreements with the U.S. and NATO that allow foreign troops to remain in the country after their combat units withdraw this month. (Jawad Jalali/EPA)

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 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 the 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 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 causing 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 will be able to meet targets for contributing troops to the approximately 12,000-strong training force by Jan. 1, the United States will keep a larger number of troops in the country, at least until 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, a step toward ending the U.S. 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 counterterrorism mission focused on al-Qaeda.

U.S. officials said the need for a “bridging solution” resulted from a long delay in finalizing the security agreements required for foreign troops to be able to remain in Afghanistan after 2014. Officials described the U.S. decision as a stopgap measure to ensure the NATO training mission can be launched as planned.

The evolution of plans for the future U.S. military force in Afghanistan follows Obama’s recent decision to expand authorities for American 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 assistance. Afghanistan also will require billions of dollars of outside aid to fund its 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.

Karen DeYoung contributed to this report.

Map/graphic: Afghan forces are expected to take the lead or have full responsibility for security across their country by the end of 2014.