WASHINGTON — President Obama’s decision to maintain troop levels in Afghanistan through 2015 is partly designed to bolster American counterterrorism efforts in that country, including the Central Intelligence Agency’s ability to conduct secret drone strikes and other paramilitary operations from United States military bases, administration officials said Tuesday.

Mr. Obama on Tuesday announced that he would leave 9,800 American troops in Afghanistan until at least the end of the year. The announcement came after a daylong White House meeting with President Ashraf Ghani of Afghanistan. The two men said the decision was a necessary response to the expected springtime resurgence of Taliban aggression and the need to give more training to the struggling Afghan security forces.

But two American officials said that a significant part of the deliberations on the pace of the withdrawal had been focused on the need for the C.I.A. and military special operations forces to operate out of two large military bases: Kandahar Air Base in southern Afghanistan and a base in Jalalabad, the biggest city in the country’s east. Reducing the military force by half from its current level, as planned, would have meant closing the bases and relocating many of the C.I.A.’s personnel and its contractors.

Jalalabad has been the primary base used by the C.I.A. to conduct drone strikes in the tribal areas of Pakistan. The drone operations were relocated there after the Pakistani government kicked the C.I.A. out of an air base inside Pakistan. The pace of drone strikes there has declined significantly since the peak during the early years of the Obama administration, but intelligence officials have lobbied to keep enough of a military presence in Afghanistan to allow the drone program to continue.