Royal protection: Prince Harry stepped in to defend an openly homosexual soldier who was threatened by other troops

A gay soldier told last night how Prince Harry bravely rescued him from a terrifying homophobic attack by squaddies from a rival regiment.

The Prince stepped in to save Trooper James Wharton after he was confronted by six soldiers threatening to ‘batter’ him.

Trooper Wharton fled to find Harry – who was his tank commander – and tearfully told the Prince what had happened.

‘I told him, “I think I’m going to be murdered by the infantry.” I climbed into the turret and talked Harry through exactly what had happened. He had a complete look of bewilderment on his face.

‘I couldn’t stop the tears from welling up in my eyes. He said, “Right I’m going to sort this s*** out once and for all.”

'He climbed out of the tank and I poked my head out of the turret a few moments later to see him having a go,’ Wharton said.

Harry, a Troop Commander in the Blues and Royals, confronted the tormentors, warning them they would face severe discipline if they continued their violent threats.

‘I could see he wasn’t holding back,’ said Wharton, who was 21 at the time.

After taking on the gang, Harry briefed a senior officer before returning to assure Wharton the situation had been ‘sorted’.

The soldier, who quit the Army earlier this year, said: ‘I will always be grateful to Harry and I will never forget what happened. Until he went over and dealt with everything I was on track for a battering.’

The remarkable incident reinforces the view of Harry as an officer with unfailing commitment to the troops under his command.

The confrontation came on a training exercise in Canada in September 2008 and is detailed in a book Wharton has written about his ten-year military career, Out In The Army – exclusive extracts from which appear in today’s Mail on Sunday.

Tory MP Colonel Bob Stewart, who led British troops in Bosnia, added: ‘Well done Harry, excellent leadership. It’s typical of him and typical of young officers in the British Army today, really superb.’

And Ben Summerskill, of the gay and lesbian charity Stonewall, said: ‘I take my hat off to him for protecting James Wharton.’

Scroll down for video

Wharton’s book offers the most unvarnished insight yet into Harry’s life as a soldier.

The two shared several weeks together in their tank and became firm friends, even swapping details of each other’s sex lives. Harry revealed details of his ‘first time’.

Wharton, who served in Iraq, also told how Harry said he and Prince William considered themselves to be gay icons.

He said: ‘We were on manoeuvres and talking over the intercom.

‘Harry happened to mention that he and his brother had been told they were gay icons. I laughed and told him that I didn’t think that was the case. He became really adamant saying, “What? What? We are! Our press people told us.”

‘Harry then asked if he couldn’t be a gay icon because he was ginger. It was all very funny.’

Last night, the Ministry of Defence and Buckingham Palace both declined to comment.

How Harry saved me: The jaw-dropping story of the day 'Top Gun' Lt Wales stepped in to protect the only openly gay soldier in the Army

It was my first night in the Army, and the platoon sergeant was laying down a few ground rules for our basic training.

‘Be on time; have the correct equipment; don’t bully anyone; and don’t come out if you’re a fag . . . I can’t stand faggots,’ he said.

I was startled. Was the Army that openly homophobic? Maybe being gay just wasn’t allowed. His statement rendered me totally confused and I could feel my heart shudder.

Pride: James Wharton, seen posing for Soldier magazine as the first gay serviceman to be featured on their front cover, was defended by Prince Harry during a training exercise

Homosexuality had been legal in the British Forces since 2000, but there was still a long way to go. I found this to my cost just few years later when I woke badly injured in Chelsea and Westminster Hospital, the result of a vicious attack by a fellow soldier at my Knightsbridge barracks.

He had kicked, punched and battered me with an iron pole as he screamed words like ‘queer’. I looked horrific. The blood was oozing out of me. If he’d continued, he’d have faced a murder charge.

But 12 months later, when one of my officers in the Household Cavalry looked at a photograph of me and my boyfriend on my barrack room wall – and told me we looked good together – I knew I had made the right decision to be open about my sexuality.

That officer was Prince Harry, and he was to prove one of my greatest protectors.

I was on a four-month training exercise in Canada in 2008 when they told me that I would be working with Prince Harry. My regiment, the Household Cavalry, was to provide battle-hardened ‘enemy’ opposition for other units from the British Army and our base was a tiny spot in the middle of the vast Canadian prairie.

The nearest town, Medicine Hat, was an hour’s drive away. The bar on camp was called the Longhorn. It was astonishingly cheap and regularly smashed up.

Soon after arriving, we headed out on exercise in our armoured car when the squadron leader said I was no longer going to be his driver. I was delighted. After months of training for the role, I was to become a gunner. [Operating the gun in a tank.] He told me: ‘You’re going to gun for the new 2IC [second-in-command]. You two will work nicely together . . . it’s Lieutenant Wales.’

It took me a few seconds to realise exactly who Lieutenant Wales was.

‘He’s arriving next week. Don’t tell the guys, most of them have never met him.’

I could hardly believe that events had taken such an incredible turn. I’d desperately wanted to be a gunner – and I was to be the gunner to the third in line to the throne.

The squadron leader arranged a night out at a bowling alley in ‘Med Hat’, during which Harry would be introduced. My cockney room-mate Joe Pank’s face dropped as he spotted him over my shoulder.

‘Holy f***! Prince Harry is here. What’s he going to be doing?’

‘He’s our new 2IC and I’m his gunner,’ I told him.

Harry the hero: When L/Cpl Wharton was threatened, Prince Harry had no qualms of stepping in himself to 'sort this s*** out'

I could see the excitement on everybody’s faces. He made morale rocket just by turning up and saying hello. The leader brought Lieutenant Wales over to me.

‘And you remember Trooper Wharton?’ the leader said [we’d met before on a training exercise].

‘Of course I do! How are you, Ronald?’ Harry said, as he offered his hand and I shook it, telling him I was fine. I said: ‘I’m your gunner for the next four weeks.’

‘Brilliant,’ he replied. ‘I hope you gun better than you bowl.’

The ice was broken. I’d wondered whether Harry was going to remember me and whether I’d have to go through the whole ‘who am I’ situation again.

Over the course of the coming weeks, we’d share an awkward chat about my break-up with my boyfriend Thom. He seemed surprised by the news.

Everybody on the base was aware of Prince Harry’s presence and people began to point at me mouthing ‘Prince Harry’ and ‘gay gunner’.

It didn’t seem to cause any trouble until one boozy night in the Longhorn when some of the guys from the infantry we’d be fighting alongside wanted to know all about Harry.

Mid-chat, one of the infantry soldiers leaned over and asked if he could buy me a drink. I naturally accepted the offer.

He was a younger chap, about 19. I took his beer and carried on the conversation but, for some reason, I felt something in the air.

Fear: After inadvertently outing another soldier, James was threatened by other troops

As the night continued, I became convinced he was looking for a friend for the evening. All of a sudden, the guy had invited himself back to my room.

The following morning, I made a fatal mistake. Some of the boys were in competition as to who had got ‘laid’ the most while in Canada.

I stupidly said, very proudly, that I’d scored the night before. Everyone knew who I was talking about. I knew it wouldn’t take five minutes for the story to swoop the tank park.

Harry found the whole thing quite amusing. He jokingly referred to me as a dirty dog before walking off to do something on our vehicle.

When the news reached the infantry, things went into overdrive. Some of them circled the poor lad, taunting him. I’d caused the whole thing by opening my big mouth. I’d practically outed the poor guy.

Panicking, I dropped down into the turret of the tank I was working on and began carrying out some maintenance on the gun.

Then my mate Danny appeared, panic on his face, too. ‘Mate, you need to come down here, it’s all kicking off,’ he said.

Standing in front of me were six extremely angry infantry sergeants. ‘Have you been spreading rumours about our Martin?’ I was asked.

I didn’t even know his name.

‘Why have you been lying? He’s no faggot!’

This was turning into a bit of a situation. Danny told them everything he’d seen and to back off. Under huge pressure I went back to my vehicle to find Prince Harry.

‘Sir, I need to talk to you.’

‘Why? What’s up? Are you OK?’

Harry instantly looked concerned. I told him: ‘I think I’m about to be murdered by the infantry.’

I climbed into the turret and talked Harry through exactly what had happened. He had a complete look of bewilderment on his face.

I didn’t hold back: I told him everything that had gone on. I couldn’t stop the tears from welling up in my eyes.

He said: ‘Right. I’m going to sort this s*** out once and for all.’

Harry climbed out of the tank and started having a go. I worried he was about to make the whole thing worse, but he wasn’t holding back. Prince Harry was sticking up for me and putting a stop to the trouble. I had been on track for a battering and had been rescued.

He came back ten minutes later and told me the problem had been ‘sorted’.

He told me: ‘I knew one of his officers and we cleared everything up. I also told those other lads to back the f*** off, too.’

Soldiers put their pints down and looked at me. I made my way over to my friends. To hell with it. I’d done nothing wrong.

With the tension getting worse by the minute, Danny told a few of the boys to stay in case things kicked off. My friends were ready to fight for me.

After a few pints, I found the courage to approach one of the infantry guys who seemed to be the centre of attention. He was tall with short blond hair, an athletic rugby player and probably the ‘popular’ guy of the gang.

One of the lads: Prince Harry, pictured at Camp Bastion in 2012, joined in on a game of Xbox and showed nothing but support of L/Cpl Wharton's relationship with his boyfriend

Dreading the worst, I tapped him on the shoulder expecting to be punched square in the face. Very much to my relief, my direct approach paid off.

The guy, called Josh, agreed to talk. We grabbed an empty table and he eyed me with curiosity. He listened to my story and surprised me by saying he understood.

Lieutenant Wales looked a little surprised to see me in one piece, unbeaten, and mentioned that I’d ‘survived the night’.

I knew I could trust him, so I leaned over to him and told him I’d done more than survive.

‘F*** off! Who?’ he said, looking at me straight in the eyes. He couldn’t believe that I’d done exactly the same thing again.

As the morning continued he’d keep muttering words like ‘outrageous’. Then, quite unexpectedly, Harry’s mobile phone rang and he answered it with a ‘Hey Dad! How’s it going?’ How incredible!

Harry remembered me because we had met previously during a three-week exercise on Salisbury Plain, when he slummed it in the dirt with the rest of us.

We were all gutted when we were ordered to spend one final, pointless, extra night there – particularly when somebody realised it was Bonfire Night.

Prince Harry and his close- protection officer drove into town to buy a stockpile of fireworks. An hour later they returned and the entire squadron gathered to watch the most exclusive display in the world: Prince Harry’s personal one.

It was fabulous. If anybody had anything against the Prince before that gesture, I’m sure they changed their minds.

It was when I was based at Knightsbridge barracks in London and taking part in ceremonial duties such as Trooping the Colour that I ‘came out’ to a group of friends from the Household Cavalry.

'Is it because I'm ginger?': Prince Harry questioned why he was not a gay icon

To my amazement, my closest friend stood up and hugged me. He and the others promised to stand by me.

Within hours I was the talk of the regiment. But after the initial shock, everyone else seemed to accept me for myself, too.

Prince Harry took the same relaxed view. In the build-up to my deployment to Iraq in 2007, I had a couple of the boys from A Squadron of the Blues and Royals – my unit – in my room playing on my Xbox.

Harry had joined us for a bit of fun, scouted over my photos and asked me a few questions about who people were. I’d pointed out Thom to him and he asked if he was my boyfriend. He seemed genuinely interested.

In later meetings, he’d asked about Thom, about when I discovered I was gay and we shared other personal stories.

As we trained for deployment to Afghanistan or Iraq, I came to respect Harry as a natural leader who took it upon himself to learn more about the men he’d be going to war with. He knew me by my nickname, Ronald, and was quite relaxed about it.

It wouldn’t always be that easy.

The man who attacked me at Knightsbridge was court martialed, but remained in the Army.

I saw him a few months later, kissing another man in the corner of a nightclub. I realised then how messed up some people are about their sexuality.

We hadn't been in Canada long when the squadron leader called me to his office. I thought it must be to do with the shenanigans in the Longhorn. I knocked on his door, looking quite sheepish.

‘Ah, Trooper Wharton. I have a very important job I need you to carry out in secrecy,’ he said.

The office door was shut behind me. ‘Tomorrow is Lieutenant Wales’s 24th birthday. I want you to get a cake.’

I requisitioned a car and drove to the Walmart in Medicine Hat, where I had the choice between a Sesame Street cake and one featuring the 101 Dalmatians. I opted for Sesame Street, paid £12.50 and was back in base an hour later.

The following morning, I carefully placed the cake in the back bin [of the tank] and covered it with camouflage. Our driver, Dan, was in on my secret. Eventually we rolled out of the gates on to the prairie. As we bobbed along, Harry and I occasionally banging our hips on the hatches to our turret, the three of us bantered over the vehicle’s intercom system, the only way we could talk because of the noise of the engine.

Harry mentioned that he and his brother had been informed some time ago that they were both gay icons, which made me laugh.

He replied: ‘What? What? We are!’

‘I don’t think you are, sir!’ I said.

‘Why? We are! Our press people told us!’ Harry insisted.

I said: ‘Honestly, I’m sure you’re not . . .’

And he replied: ‘Is it because I’m f***ing ginger?’

Dan giggled, Harry laughed and we returned to the task at hand.

When we arrived at our destination, the leader quietly told me to prepare the cake, shoving a bunch of candles into my hand. I sneaked to the back of a Land Rover, lit the candles and, with little choice other than to hope for the best, shielded the cake and candles from the howling wind out on the plain. On cue, the guys burst into jubilant song.

I presented his cake, with its now-extinguished candles, and wished him a happy 24th birthday.

‘You’ve f***ed this up,’ he joked, shaking my hand. It was exactly the right level of humour required. The leader led the applause and the three cheers.

Real trooper: Lance Corporal James Wharton speaks of his life as a gay soldier - and his time training with Prince Harry - in his new book Out In The Army

Harry was the prize target during the exercise in Canada – and responded with a display of great leadership.

The enemy had discovered our vehicle call sign was 9.1, but Harry outsmarted them from the start, swapping our number with another vehicle, much to the dismay of an outranked corporal. It was just one example of his sharp wit and clever tactics.

The exercise got off to a flying start. Between the two of us we had a good tally of confirmed kills and Dan was an excellent getaway driver.

One night, we were ordered to make a long drive in full tactical conditions. Dan had his night-vision sight and Harry was using a night-vision device he’d acquired from somewhere.

Suddenly, there was chaos in the blackness.

None of us had noticed a sudden drop that felt like driving off a cliff. As we hit the bottom, the three of us were knocked around our small vehicle. I was thrown forward and my head hit the sighting equipment. I could hear that Dan was conscious so I looked over to Harry, in the centre of the turret, dreading what I’d see. Like me, he was rubbing his face. I grabbed him to make sure he was OK, but he told me to ‘man the f*** up’.

Mid-exercise, Harry returned from a briefing in excitement: ‘Great news, we’ve got the most kills!’ To be in the running for ‘top gunner’ on my first exercise was incredible.

‘I want to win this title!’ Harry exclaimed. Another ‘enemy’ call sign was catching up fast.

Back in action, we encountered a fully exposed main battle tank. It was a dream target but when Harry gave the order to fire, nothing happened.

Our armoured vehicle was fitted with a laser weapon. If we hit the enemy, sensors would disable their vehicle, making them redundant from the war game. We had the same sensors, so if they scored a direct hit on us we’d face a lengthy spell immobilised.

I’d made a mistake by forgetting to press a crucial button – not for the first time either. But now we desperately needed to improve our kill tally. Harry turned to me. I knew I was in for an ear bashing. ‘If you forget to do that again, I’m seriously going to knock you the f*** out!’ he cried.

He wasn’t joking. I’d failed and he was furious. Hardly a word was spoken until we were taken out of the battle. Marooned for six hours, with mock battles raging around us. Harry took the opportunity to chat.

He asked me when I realised I was gay. Dan piped up with another question: ‘Have you ever had a girlfriend, like?’ he said.

‘Yeah, I had one when I was growing up, nothing too serious though,’ I told them. I thought that might have been the end of the conversation.

‘Did you sleep with her?’ asked Harry. ‘I did, actually,’ I said. ‘I don’t think I was ever any good at it though. I certainly didn’t enjoy it.’ We laughed.

Dan explained the circumstances surrounding the loss of his virginity, captivating both Harry and me.

‘Well, you’ve heard ours,’ I said, turning to Harry. ‘When did you pop your cherry?’ Harry told us both an extraordinary tale about the first time he’d had sex. It was fascinating. Sharing our personal stories, the three of us bonded as a team.

Cherry popping: Prince Harry, pictured earlier this year filming at Camp Bastion, Afghanistan, shared some very intimate moments at the training camp

Our final day started with us level-pegging for Top Gun. We were to lie in ambush, and claimed three easy kills when the enemy appeared right on time. We carried on the hunting game and took out another two vehicles. Our chief rival drove into our area and was destroyed in a flash by a group of infantry armed with anti-tank weapons. Harry and I laughed as we saw the commander throw off his headphones in disgust and reverse back to us. ‘How many kills did you get?’ he said.

I was about to reply with the truth, but Harry beat me to it. ‘About 12!’ The commander’s face dropped before they drove off. ‘I’m not letting on to those c***s!’ Harry said, a grin on his face.

When the war was over, the colonel from the infantry regiment wanted to say a few words and present the Top Gun award. Harry, Dan and I stood together. ‘The crew with the most kills has performed far better than anyone ever expected. They showed grit and determination throughout. So I’d like the commander of 9.1 to come out and collect this award, Lieutenant Wales!’

Harry sprang to attention and marched out. I couldn’t believe he was being rewarded for my skill behind the gun. Where was the justice? He accepted the award and the entire enemy force applauded.

Afterwards, the squadron leader came to congratulate me. I moaned that I’d not received a medal. He laughed: ‘That’s how it works, Trooper Wharton. The commander always takes the glory.’

And he was right. Harry’s strong leadership – far stronger than most of the officers I’d worked with before – had been decisive. I’d learned a hell of a lot from him: how to navigate best with a GPS, how to ‘sneak’ around hillsides without exposing the vehicle and, more than anything, how to command with real leadership. Without his motivation we’d not have achieved Top Gun status.

I enjoyed every bit of the exercise with Harry. I appreciated his openness, the way he spoke with personality on almost anything, the way he almost stripped his royal title off himself every time he entered the turret next to me.

Most of all, I admired his kindness. I’ll never forget the four weeks we worked together and the incredible conversations we shared. The experience lives on as the stand-out period of my decade in the military.

Out In The Army, by James Wharton, is published by BiteBack, priced £16.99. To order your copy for £12.99 with free p&p, call 0844 472 4157 or visit mailbookshop.co.uk.