Neil Patrick Harris has spoken about the real reason his character on How I Met Your Mother seemed so “toxic” – and why the character’s sinister side wasn’t always as it seemed.

Harris, 53, played the womanising, well-to-do Barney Stinson in all nine seasons of the hit sitcom, which ran on the US network CBS between 2005 and 2014.

The character was framed in the show as an unscrupulous playboy, with fans and critics noting that the character embodied what is often described as “toxic masculinity”.

In an interview with The Times, Harris was asked about the “toxic” nature of his character. He noted that the entire sitcom is framed as a story told by an older Ted (Josh Radnor in flashbacks, Bob Saget in narration) – meaning that the depiction of Barney was coloured by the subjective nature of the story.

“None of the behaviours are, you know, certified, or even true,” he said. “So I had the freedom to be much more lascivious, much more ridiculous and overt than I imagine Barney probably actually was.

“He was always the devil on Ted’s shoulder,” Harris added.

In 2023, Harris reprised the role of Barney in the How I Met Your Mother spinoff, titled How I Met Your Father.

The show, which ran for two seasons on Hulu, brought back Harris’s character for two episodes in its second season – despite the actor’s previous claims that the character wouldn’t return for fear of “getting everyone in trouble”.

Speaking to How I Met Your Father star Hilary Duff in an interview for his Wondercade newsletter, Harris wrote: “As for coming on your show (insert joke here), I worry.

“Barney’s antics, his overt delusions of grandeur, would likely get everyone in trouble. So, unless he’s changed his ways or joined a nunnery (insert an insert joke here), not sure if it’s in anyone’s best interest.”

Duff concurred with the reasoning, joking: “I’m not sure how you feel about this, but I’m pretty sure Barney would… be in jail in 2022.”

How I Met Your Mother was a consistent ratings smash during its initial run, with the early seasons also earning strong reviews from critics.

Over the course of its run, How I Met Your Mother was nominated for 28 Emmy Awards, including a nod for Outstanding Comedy Series.