Kyle XY star Matt Dallas has revealed that executives on the hit US television show encouraged him to remain silent about his sexuality.

The actor played the titular character in the ABC Family show for three seasons from 2007 to 2009.

He didn’t publicly come out as gay until years after the show had finished in 2013, going on to marry his partner Blue Hamilton in 2015.

Matt has now explained that his decision to not come out in the public forum wasn’t necessarily his, and that he was led to believe he should for his career.

“I was told to stay in the closet,” he said in a YouTube video. “Not talk about my sexuality, to be on every red carpet with a girl on my arm – because you could not be successful if you were openly gay in the entertainment industry, at least in front of the camera.

“I wish I had not taken that advice.”

He continued: “Because of the advice that was given to me to stay in the closet, I became very disconnected from who I was.

“There’s a lot of residual stuff that to this day that I still deal with where I find myself [thinking] ‘I sound too gay’ or ‘I’m acting too gay’ because it was so drilled into my brain.”

Every Tuesday, Matt and his husband Blue post a new YouTube video to their channel talking about their family life, having fostered a son just before Christmas.