The attack happened as his team were advising the Afghan police and visiting a checkpoint in Helmand’s upper Gereshk valley.

As they left the checkpoint an Afghan policeman in a watchtower began shooting with his AK-47, pouring a devastating barrage of fire from close range into a confined corridor leading to the exit.

Three soldiers were instantly severely wounded and L/Cpl Shaw was shot through his backpack and boot as he got out, though somehow not injured. He immediately shot back at the watchtower. His team commander, Lt John Scarlett, ran into the checkpoint to tend to the wounded, but was himself shot and incapacitated.

L/Cpl Shaw then ran back into the checkpoint where four of his colleagues now lay severely wounded, even as the policeman was still shooting. Faced with the terrible decision of choosing who was most likely to survive, he dragged Lt Scarlett out and began giving life-saving first aid. When the rest of his team overcame the shooter, he then treated the remaining wounded, however all three died of their injuries.

The citation for his medal said: “Shaw’s actions during that horrific attack were in the very finest traditions of the British Army.”

Lt Scarlett, the son of former MI6 chief Sir John Scarlett, was himself awarded the Military Cross for his bravery during the incident.

Another medal winner, the former commander of Britain’s main field hospital in Afghanistan, told how staff had to deliver a baby to a pregnant soldier as they treated a badly wounded casualty.

Lt Col Andrea Lewis recalled the birth as she received the Royal Red Cross medal for running the hospital in Camp Bastion which is more used to dealing with gunshot wounds and blast injuries.

Staff were already tending to another British soldier when a female Lance Bombardier arrived with severe abdominal pains and nurses realised she was going into labour.

“That was an interesting day and a unique experience for Bastion,” Lt Col Lewis of Queen Alexandra’s Royal Army Nursing Corps said.

Lance Bombardier Lynette Pearce, gave birth to a healthy boy at Camp Bastion in September 2012 despite reportedly being unaware she was pregnant.

Lt Col Lewis, said: “We had a UK case come into the emergency department and the team were working on injuries to his legs.

“We then had this female soldier walk in with abdominal pain who was in labour. My team were brilliant. We had half of them looking at the casualty and half with the soldier in labour.”

The other soldier subsequently had a leg amputated.

The field hospital in Bastion is one of the busiest trauma centres in the world and is renowned for saving grievously wounded casualties.

Prince Charles, awarding Lt Col Lewis her medal, said he was “in awe” of its achievements.

Laura Trott, the double gold medal winning British Olympic cyclist also received an OBE from Prince Charles.