Sgt Deane Smith, a soldier in the Household Cavalry, is releasing the first account of Harry's time at war

Prince Harry was no more than 220 yards away when a US trooper standing aboard an armoured vehicle cocked a .50 calibre machine gun and fired successive bursts at Afghan shepherds tending their goats, The Mail on Sunday can reveal.

The shocking incident, which was confirmed last night by the Ministry of Defence, triggered a war crimes investigation by US military police.

It took place on Harry’s first frontline tour of Afghanistan, which, until today, has been shrouded in secrecy.

Sgt Deane Smith (top left) and prince Harry (centre) with the rest of the Household Cavalry troops

At the time Harry’s squadron from the Household Cavalry Regiment (HCR) were mounting joint patrols in Helmand province with a US Special Forces unit codenamed ‘Task Force 32’.

According to a British eye- witness the three shepherds were peacefully minding their own business when they were engaged.

Given the force of the heavy machine gun rounds it is likely they suffered serious or fatal injuries, though their bodies were never recovered.

When the US trooper ceased firing, Harry’s commander, Major Paul Bedford, marched over to where the American vehicles were parked and raised the concerns of British soldiers who were adamant that the engagement was entirely unjustified.

Harry’s colleague Sergeant Deane Smith, 40, was so enraged that he recorded his reaction on a video camera, saying: ‘The Americans are fifty-caling [machine-gunning] goat herders and it’s disgraceful!’

Prince Harry directing a helicopter on his 2008 tour. he is described as having been incredibly brave during his time there

Sgt Smith then zoomed in on the armoured vehicle from where the US trooper had launched his attack.

Sgt Smith, a commando engineer, has given the first graphic account of Harry’s front-line experiences and how the Prince dodged repeated Taliban ambushes.

Harry’s first tour ended in February 2008 after an Australian magazine broke a media embargo over his presence in the war zone.

Subsequent reports suggested Harry was treated as a VIP rather than just another junior officer while he was there. In fact, as this newspaper has established, he was pitched into the thick of the fighting.

Sgt Smith has told The Mail on Sunday how the day before Task Force 32 opened fire on the shepherds, Harry witnessed the deaths of young children when a Taliban rocket intended to strike his vehicle missed its target and struck an Afghan family home.

The US troop vehicles moments after the attack on the shepherds. British troops complained about the attack

Sgt Smith also described how Harry, then just 23, displayed a remarkable empathy for his soldiers, some of whom were overwhelmed by the horrors of war.

He said: ‘I’ll never forget the Yank opening up on the shepherds, which was a completely unjustified attack and sadly typical of how the campaign was conducted. But Harry had a way of reconciling everything he saw and keeping his emotions in check, often when more experienced soldiers were crying their eyes out.

‘On the day of the rocket attack on the family home, Harry was there, comforting a soldier as the charred remains of young children were removed.

‘He also arranged for the wounded to be transferred from the battlefield to a military hospital.

‘The dead were very young, their arms the width of two of my fingers. This was horrible to see.

Prince Harry on a cigarette break after the battle of Musa Qala. he was furious when he was forced to leave

‘In early 2008, I spent ten weeks in Helmand with Harry and he was fearless throughout, even when armoured cars were being blown up and he was being shot at.

‘Looking back, I can’t believe he was so keen to subject himself to such danger.’

Sgt Smith added that Harry’s disregard for his safety unsettled his soldiers, who would implore him to swap his favourite baseball cap for a protective helmet whenever enemy rounds were fizzing overhead.

Harry also came within a single stride of setting off a live IED (improvised explosive device), a brush with death he laughed off as he lit another from an endless chain of cigarettes.

Harry was apparently critical of British tactics and complained when his armoured column were ordered to retreat – at the time UK and US forces were involved in Operation Snakebite, the battle to recapture the town of Musa Qala in Helmand province from the Taliban.

Prince Harry, pictured on patrol in Helmand Province in 2007-08, retrained as an Apache helicopter pilot

Sgt Smith recalled: ‘I vividly remember Harry and I driving outside Musa Qala – with enemy rockets air-bursting above us and rounds pinging off the armour-plating of our vehicles – when we were told to withdraw.

‘Harry was furious, shouting about how we’d never beat them if we didn’t attack their positions and eliminate them.

‘He couldn’t believe the appalling state of our vehicles either, they were always breaking down in battle and the noxious gases given off by the fuel that leaked into the cabins used to make the drivers vomit.’ Sgt Smith was also with Harry when he was told he had to be withdrawn from Afghanistan.

Major Bedford (centre) raised concrns about the attack. Pictured with Sgt Deane Smith and CoH Stevens

Sgt Smith said: ‘Harry was saying, “I can’t believe it, I can’t bloody believe it. I’ve been here so long I might as well stay, I really want to.” I asked why if the top brass were suddenly so concerned about Harry’s safety they couldn’t get a helicopter out to us to collect him.

Apparently there were none available. There was a real squeeze on aircraft back then and all the choppers were designated for anti-ordnance teams that were defusing IEDs across the province.

‘So I was told to plan a route for us back to the district centre of Musa Qala, apparently he could get a helicopter from there. So the lives of 50 soldiers were put at risk to drive Harry through areas that were littered with enemy mines.’

When the vehicle column reached a narrow bridge over the Kariz Deh Baba wadi (riverbed), Sgt Smith scoured the ground for explosive devices, finding two bombs that could have killed the Prince.

When the column reached Musa Qala, Harry bade his comrades a fond farewell and distributed his remaining sweets and cigarettes.

Sgt Smith, who left the Army last week, now intends to write a memoir about his experiences.

Harry subsequently retrained as an Apache helicopter pilot – a much safer role according to Defence sources – and returned to Afghanistan in 2012.

The Ministry of Defence and Buckingham Palace declined to comment on details of Prince Harry’s operational service.

The US Defence Department has promised to publish the results of its criminal investigation and any disciplinary action taken against the Task Force 32 soldier involved in the incident with the shepherds.