An investigation is under way to establish whether two British servicemen were shot dead by an Afghan army recruit working for the Taliban.

The inquiry was launched following the tragedy, which occurred at the gate of the British headquarters in Lashkar Gah city in Afghanistan yesterday.

It has been a month of heavy losses for UK troops, with six soldiers being killed when their armoured patrol vehicle was blown up by a bomb on March 6. It was the worst single loss of British personnel in the conflict since the Nimrod crash of 2006.

The Royal Marine and the soldier, a member of the Adjutant General's Corps, died when the gunman opened fire outside the Nato army base yesterday. The Afghan soldier was killed in a shoot-out with other servicemen.

Separately yesterday, a third Nato soldier, who was not British, died when he was shot by a member of the Afghan local police at a checkpoint in the east of the country.

Labour's Shadow Defence Secretary Jim Murphy questioned the procedures for vetting recruits to the Afghan security forces.

He said: "Since 2007, Afghan forces have attacked Nato forces, resulting in 75 fatalities. Most of these attacks have taken place over the past two years.

"In light of previous incidents, what new procedures have been implemented to vet Afghan recruits?"

Brigadier General Sherin Shah, of the Afghan National Army, described the incident, which involved a member of the Fourth Kandak of 3-215 Brigade, as "a tragic event".

He said: "The incident is still under investigation and it is unclear if the action was planned or influenced by the enemy or if he acted alone.

"Either way, it is with the deepest regret that two Isaf (International Security Assistance Force) soldiers who came to our country to provide security are now dead.

"I would like to convey my deepest condolences to the soldiers' families and the British Army and Royal Marines, especially Task Force Helmand, for their loss."

Major Ian Lawrence, spokesman for the UK's Task Force Helmand, said: "Sadly, I must report that a Royal Marine and a soldier from the Adjutant General's Corps were shot and killed by an Afghan National Army soldier at the main entrance to Lashkar Gah main operating base. The thoughts and condolences of everyone serving in the Task Force are with their families and friends."

Defence Secretary Philip Hammond added: "Our thoughts, as ever, are with their families, for whom this will be a deeply personal tragedy." The attack appears to be the latest in a string of "green on blue" attacks in which members of the Afghan security forces have opened fire on their allies.

Five British soldiers were killed by a rogue Afghan policeman in November 2009. The gunman opened fire on the men in a military compound in Nad e-Ali before fleeing. The Taliban later claimed responsibility.

Such attacks have become increasingly common in recent months, particularly since the burning of copies of the Koran at a US base in February.

Fifteen Nato service members have been killed by Afghan security officials or militants disguised in their uniforms so far this year.

Armed Forces Minister Nick Harvey said "force protection" was kept under review and added: "We have changed our procedures in the light of events, both recently and over a longer period of time."

Mr Harvey said the decision to partner UK troops with Afghan forces involved "a considerable degree of risk" but "this is a risk that the last Government was right to compute that it is worth taking, and it's the only way, frankly, we are going to ingrain the necessary skills and culture into the Afghan forces and complete our mentoring task".