The animated sequel to How to Train Your Dragon, a children’s film set in the Viking period, will feature a gay character, it has been revealed.

Speaking to the director of the film, Dean DeBlois, E! reports that Gobber, voiced by Scottish-born US late night talk show host Craig Ferguson, will be the character that reveals he’s gay.

At the premiere of the sequel, the director announced that: “Gobber is coming out of the closet!

“I think that’s a really fun and daring move to put in. I love the idea that Gobber is Berk’s resident gay”.

DeBlois who is openly gay himself, explains that Gobber witnesses a couple arguing and responds with: “This is why I never got married” and “one other reason.”

Gobber coming out wasn’t scripted. Craig Ferguson added the “ad-libbed” story line whilst recording the voice for the film.

DeBlois is considering expanding the character’s gay storyline in the third instalment of the franchise, saying: “It does make for an interesting revelation because now, what does that mean, do we shed a little more light on Gobber’s love life?”

Star of the film, Jay Baruchel said: “Preaching tolerance in any respect is never a bad thing. I don’t know if drawing a massive amount of attention in the middle of a kid’s movie is, like, necessarily what you should be doing, but listen, if somebody catches it, then good for them.”

The director thought the introduction of an openly gay character would break down the stigma attached to animation, that it’s “just for kids,” calling the franchise his “personal crusade.”

How to Train Your Dragon 2 will be released in the UK on 28 July 2014.