The shooting, which occurred in the Sharana district of Paktika Province, also most likely wounded at least one other soldier, but details about the extent of the damage were not immediately available. A spokesman for the provincial governor said the attacker had escaped.

A Taliban spokesman could not immediately be reached for comment, and the Taliban did not issue a statement claiming responsibility for the attack.

Despite the recent attacks, the number of so-called insider attacks has substantially declined this year, thanks to a broad effort by both the coalition forces and their Afghan counterparts. So far this year, 15 coalition service members have been killed in 10 attacks, compared with 55 killed last year in 43 attacks during the same period.

The tactics used to decrease insider attacks, which threatened to derail the American-led training mission and the ultimate withdrawal of foreign troops, include embedding Afghan intelligence agents into military bases to ferret out infiltrators. The Afghan authorities have also enhanced the screening process for new recruits and for soldiers returning from an extended leave.

The United States, meanwhile, has a far smaller number of troops in Afghanistan this year compared with last year. American troops are operating on fewer bases and engaging far less in operations alongside their Afghan counterparts.

The sharp decline in such deaths has meant that the issue of insider attacks has largely diminished this year, compared with 2012, when the episodes dominated discussions of Afghanistan and prompted the coalition to order a brief suspension of all joint training activities.

During the past year, and particularly over the past several weeks, the issue or the continued presence of American troops in Afghanistan has been somewhat uncertain, as Afghan and American officials negotiated a long-term security agreement.

The negotiations had become acrimonious, leading some American officials to consider a complete withdrawal from the country. But after a lengthy meeting on Saturday, Secretary of State John Kerry and President Hamid Karzai agreed on key elements of a deal that, if completed, would keep American troops in Afghanistan beyond 2014.

Haris Kakar contributed reporting.