KABUL, Afghanistan — For the first time, an Afghan military court convicted an Afghan soldier this week of killing troops from the American-led coalition in what is known as a green-on-blue attack.

Afghan officials said on Tuesday that the court had convicted and sentenced to death a man who gunned down four French soldiers in January in Kapisa Province, east of Kabul, on a base shared by French and Afghan forces. The attack prompted France to speed up the withdrawal of its combat forces from Afghanistan, which is now scheduled to be completed by the end of the year.

Word of the conviction in the case was unlikely to prompt France to reverse that decision, but it did open a rare window on what happens after Afghan soldiers and police officers attack coalition partners. Such attacks were once uncommon, but they have multiplied over the past three years and now pose a significant challenge for the allied forces fighting in Afghanistan and trying to train the country’s nascent army and police. Since the start of 2010, there have been 52 green-on-blue attacks resulting in 82 deaths.

Coalition officials have said they believe most of the attackers are motived by personal animus and are not Taliban infiltrators. Yet amid the increasing violence, coalition and Afghan officials have remained circumspect about the attacks, often releasing only the barest of details after each episode. The statement disclosing the Jan. 20 attack on the French troops, for instance, was only 43 words.