The Ministry of Defence is investigating pictures showing a member of the British armed forces in Afghanistan posing with his thumb up beside the dead body of a Taliban fighter.

An MoD spokesperson described the actions of the soldier as inappropriate.

The pictures, confirmed as genuine, were taken in 2012 at Camp Bastion in Helmand province immediately after an intense firefight that left two US marines and more than a dozen Taliban dead.

Two pictures show the soldier, a member of an RAF squadron based at Camp Bastion, kneeling with his thumb up beside the corpse of a Taliban fighter. Members of 51 Squadron RAF Regiment were among the first to confront the Taliban attackers.

The emergence of the pictures is unlikely to have any serious consequences. There is no suggestion of any abuse or violation of the corpse or the kind of humiliation associated with the treatment of prisoners at Abu Ghraib in Iraq, which led to fresh violence against US troops and their allies. The squadron is no longer in Afghanistan and most of the remaining British forces are no longer in frontline positions.

The incident is a breach of the law of armed conflict, but the military hopes it will be seen in context, a young man doing something foolish in the post-battle adrenaline rush. Protests could be expected if there were pictures of desecration of the Koran, but Taliban fighters are viewed as hardened enough to be relatively unmoved by a member of the British forces demonstrating victory or a sense of relief at the end of battle.

An RAF spokesperson said: "Inappropriate actions will not be tolerated in the armed forces. The RAF is treating this incident extremely seriously and has launched a military police investigation. As this incident is subject to an ongoing investigation it would be inappropriate to comment further at this time."

The BBC showed the pictures on Friday evening, saying they had first appeared on the website LiveLeak. The MoD said the pictures had come to their attention in April. Two RAF regiment members have been withdrawn from frontline duties, the soldier in the picture and, it is assumed, the one who took it. The investigation is being carried out by the Special Investigations Branch.

The Taliban attacked on the night of 14 September 2012, apparently dressed in US uniforms. They destroyed six US Harrier jets and damaged two others, the costliest attack on US aircraft since the Vietnam war.

The attack raised questions about how the Taliban were able to penetrate the heavily guarded base and prompted a House of Commons committee investigation.

The Taliban at the time claimed the attack was in response to a film it said was disrespectful of Muhammad and that Prince Harry was the target. He was on the base at the time and was moved to a secure location.

As well as the two US dead, the allies suffered 17 injured, eight of them British.