KABUL — Two US Special Forces members were shot to death on Friday by a new Afghan local police recruit they were training at a small outpost in western Afghanistan.
In a second ‘‘green-on-blue’’ attack Friday, in the south, an Afghan security force member turned his weapon on other international service personnel, wounding two US soldiers, NATO and Afghan officials said.
The two US service members who died were part of a Special Operations team working with the local police in Farah province in the west of Afghanistan, according to a NATO official who spoke on condition of anonymity.
The Americans belonged to US Forces-Afghanistan, a command separate from the main NATO force.
Special Operations forces are working closely with Afghan forces on the Afghan Local Police initiative, a group trained and financed by the United States and viewed as an important stopgap to secure remote corners of Afghanistan as international troops withdraw. Another US Special Forces service member was wounded and an Afghan police recruit was killed in the shooting, said Aqa Noor Kentoz, the police chief of Farah province.
Kentoz identified the attacker. ‘‘When the training finished, the ALP soldier Mohammad Ismail turned his weapon toward our allies and killed two of them,’’ Kentoz said.
In the second attack, in Kandahar province in the south, a member of the Afghan security forces shot at NATO service members. Nobody was killed, but some soldiers were wounded, said Major Martyn Crighton, a spokesman for the NATO-led International Security Assistance Force in Kabul.
Crighton did not give the nationality of those NATO service members who were injured. But another coalition official, who spoke anonymously because he was not authorized to comment on the nationality of those injured in the attack, said the shooting wounded two US troops.
In both cases, in Farah and Kandahar provinces, the shootings were carried out by individual attackers, and both were shot and killed, said Crighton.
The shootings were the latest in a spate of attacks by Afghan forces on their coalition counterparts.
These assaults have intensified in recent years in Afghanistan, where the military calls them ‘‘green-on-blue’’ attacks. Recently, however, the military has begun referring to them as insider attacks, including violence by people who are working inside the security force system but who may not be active members themselves.
With the two episodes Friday morning, there have now been at least 31 such attacks in Afghanistan this year, including 21 that have resulted in fatalities.
All told, the deaths of at least 39 NATO service members during the first eight months of 2012 have been attributed to these shootings.
Those numbers for deaths and attacks already surpass the figures for green-on-blue attacks for all of 2011.
The increase in the rate of this kind of violence has prompted Afghan and NATO military leaders, who are worried about the impact on morale and the propaganda boost the attacks give to the insurgents, to investigate the circumstances surrounding each one.
Defense Secretary Leon E. Panetta suggested this week that the Taliban were at least partly behind the increase in the violence.
“The reality is the Taliban has not been able to regain any territory lost, and so they’re resorting to these kinds of attacks to create havoc,’’ Panetta said.
About 11 percent of the insider attacks are because of Taliban infiltration into the Afghan security forces, Pentagon officials said Friday, citing a new analysis by the international military coalition in Afghanistan. The majority of the attacks, they said, are for other reasons, including grudges and conflicts between NATO and Afghan forces.
The Taliban, however, have frequently claimed responsibility for such attacks.
In a public statement to observe the end of Ramadan, the Taliban leader Mullah Mohammad Omar said infiltration of Afghan security forces by insurgents had been one of the group’s successes.
‘‘The enemy is not able to take a breath of relief in the main cities, rural areas and even in their barricaded garrisons,’’ he said. ‘‘The foreign invaders and their allies in their military centers and bases do come under crushing blows of these heroic soldiers.’’
Crighton said the attacks Friday were not carried out by Taliban infiltrators wearing Afghan uniforms, but were members of the Afghan security forces, according to the preliminary investigation.
“Operational reporting confirms that both cases involved members of the Afghan national security forces,’’ he said.
Abdul Rahman Zowandi, a spokesman for the Farah governor’s office, said the attacker in Farah, Mohammad Ismail, was a 60-year-old man who had been hired only two weeks earlier to train as a local police officer.
Zowandi said the attacker opened fire on the US soldiers as they were training his local police unit in the Bala Bolok district of Farah province.
He said that the local police unit had been established only two weeks ago, and that the police officers had all been hired from the local district.
In a statement on the Farah shooting, US Forces-Afghanistan said: ‘‘Two U.S. Forces-Afghanistan service members died this morning as a result of an insider threat attack in Farah province.’’