Image copyright Getty Images Image caption The internet celebrity said the offensive word "just sort of slipped out"

YouTube star PewDiePie has apologised for using the "n-word" during a video live stream, saying he was an "idiot".

"It was something that I said in the heat of the moment," he said in a YouTube post that has already racked up almost five million views.

"I said the worst word I could possibly think of and it just sort of slipped out," he continued.

The 27-year-old Swede - real name Felix Kjellberg - said there were "no excuses" for what he said.

"I'm just an idiot, but that doesn't make what I said or how I said it okay," he went on. "It was not okay.

"I'm really sorry if I offended, hurt or disappointed anyone with all of this."

PewDiePie was seen and heard using the racial slur while playing a video game on a live stream.

After using the term he appeared to recognise his error, saying: "I don't mean that in a bad way."

The online star, who has more than 57 million subscribers, has previously had to defend himself over anti-Semitism allegations.

On another occasion, he was suspended from Twitter for joking he had joined the so-called Islamic State.

"I'm disappointed in myself because it seems like I've learned nothing from all these past controversies," he said on Tuesday.

The internet celebrity amassed his following by posting recordings of himself playing video games and providing commentary.

Follow us on Facebook, on Twitter @BBCNewsEnts, or on Instagram at bbcnewsents. If you have a story suggestion email entertainment.news@bbc.co.uk.