A former squadmate of Prince Harry has revealed how the royal came to his aid when he was the target of a homophobic attack during a training exercise in Alberta in 2008.

An account of the prince’s brave actions were published Saturday, in a report in British newspaper the Daily Mail.

Lance-Cpl. James Wharton, who is gay, told the paper that the prince intervened after he was confronted and threatened by six soldiers from a rival regiment.

Wharton, who was 21 at the time, said he fled to find Harry, who was his tank commander, and tearfully told him about the incident. Wharton said, at the time, he was worried he might be killed.

According to Wharton, Harry, who was then a second lieutenant in the Blues and Royals regiment, confronted the soldiers and told them to stop or risk being disciplined.

Wharton says Harry reported the incident to a senior officer, before letting him know that he had handled the situation.

Wharton told the Daily Mail: ‘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 incident happened during a 2008 training exercise at Canadian Forces Base Suffield near Medicine Hat, Alta., where the British army has a training unit.

The prince was reported to be training there after his presence in Afghanistan was leaked in a media report.

Wharton left the British army earlier this year and has written about his 10-year military career in a book called “Out in the Army: My Life as a Gay Soldier."