Actor Johnny Depp has publicly apologised for making a Donald Trump assassination joke on stage at this year's Glastonbury Festival.

The Pirates of the Caribbean star was at the world famous festival on Thursday night for a screening of his 2004 film The Libertine and started talking about President Trump after taking questions from the audience. 

"I think he needs help and there are a lot of wonderful dark, dark places he could go," said Depp as the crowd cheered.

"It is just a question - I'm not insinuating anything.

Depp arrived at Glastonbury in a vintage blue Cadillac

"By the way, this is going to be in the press. It will be horrible.

"I like that you are all a part of it.

"When was the last time an actor assassinated a president?" Depp said in reference to John Wilkes Booth, the American actor who assassinated President Abraham Lincoln in 1865. 

Depp meets his fans at Glastonbury

"I want to qualify, I am not an actor. I lie for a living.

"However, it has been a while and maybe it is time."

Now, Depp has issued a formal apology to US publication People for causing offence with the joke, which he said was intended to "amuse".

"I apologize for the bad joke I attempted last night in poor taste about President Trump," the actor said. "It did not come out as intended, and I intended no malice. I was only trying to amuse, not to harm anyone."

Johnny Depp apologises for "bad joke" about assassinating Donald Trump

ABC News in the US said it had confirmed that the country's Secret Service was aware of Depp's comments. After a video of Depp's remarks went viral, the White House referred to the rant as "sad". 

Earlier this month in Alexandria, Virginia, a gunman opened fire on US politicians who were practising for a charity baseball game, wounding senior Republican leader Steve Scalise and several others before being taken into custody.

Last month, comic Kathy Griffin apologised for the offence she had caused after she posted a photo which showed her holding a decapitated model head that resembled President Trump.

Kathy Griffin - "I beg for your forgiveness. I went too far. I made a mistake, and I was wrong"

As the controversy raged, Griffin was fired by CNN, having hosted its annual New Year's Eve coverage since 2007.