Updated

Separate insurgent attacks killed two U.S. troops and a top Afghan court official, authorities said Saturday, part of a surging wave of militant assaults ahead of the withdrawal of most foreign troops at the end of the month.

Security in the capital, Kabul, has been stepped up as the Taliban have warned that attacks on the government, foreigners, and the media will continue.

Late Friday, a militant attack targeting a military convoy killed two U.S. soldiers by the Bagram air base in Parwan province near Kabul, an international military official told The Associated Press. The official spoke on condition of anonymity as the information wasn't authorized for release.

NATO's International Security Assistance Force said in a statement that two service members "died as a result of an enemy forces attack in eastern Afghanistan." NATO does not identify the nationalities of the dead, relying instead on their home countries.

The deaths on Saturday were the first foreign troops killed this month, bringing to 65 the total number of international troops killed in the country this year, 50 of them Americans.

Early Saturday, gunmen shot dead Atiqullah Rawoofi, the head of the court's secretariat in Kabul's northwestern suburbs, said Farid Afzali, chief of the Kabul police criminal investigation unit. A colleague of Rawoofi, speaking on condition of anonymity for fear of reprisals, said two men on a motorbike shot Rawoofi as he was walking from his home to his car.

The Taliban claimed both attacks in text messages to journalists.

Rawoofi's slaying follows the Taliban suicide attack Thursday on a French school that killed a German citizen and wounded others during a play condemning the violence. In the past month, five foreigners, including a British embassy security guard and a South African charity worker and his two teenage children, have died in insurgent attacks in Kabul.

NATO's combat mission ends Dec. 31, 13 years after the Sept. 11 terror attacks sparked the U.S.-led invasion of Afghanistan. The alliance will leave some 13,000 troops in Afghanistan from Jan. 1, mainly in a training and support role.