Simon Cowell has apologised to Rylan Clark-Neal for making a gay joke on X-Factor.

The 57-year-old made the remarks on Xtra Factor, the spin-off show to the main programme on ITV.

As part of a segment, Rylan was responsible for opening doors to reveal fans of the show who could then ask the music mogul a question.

During the skit, Rylan said: “I love a front door.”

To which Simon replied: “I thought you liked the back door.”

The jibe received a gasp from the audience as well as fellow judges Louis Walsh, Sharon Osborne and Nicole Scherzinger.

Realising his mistake, Simon has now apologised.

“I apologise,” he said.

“I shouldn’t have said that. That’s why I should never do live TV.”

Rylan has said that it was nothing more than a joke between friends and insisted he wasn’t offended by it.

Taking to Twitter, he said: “Genuinely wasn’t offended by Simon last night but understand some people might.

“It was just a joke between friends and meant extremely lighthearted but trust me I’m more offended by the comments on social media everyday calling me worse names by pr**ks sitting behind a keyboard.

“It was banter in this case and I personally wasn’t offended.”

Earlier in the show, Simon confessed to fancying wild card act, Honey G.

The rapper has been the subject of harsh public criticism and divided opinion.

Before the season started, one of the contestants confessed to breaking up with her boyfriend for a female fan.