Gay Torchwood star John Barrowman has revealed his anger at being told by his bosses he should keep his sexuality a secret.

In his autobiography I Am What I Am, published today, he said he was warned early in his career he should pretend to be straight in order to achieve success.

Barrowman claimed a gay producer was sent by his bosses to give him the warning. He claimed the producer said: “John, we wondered if you really wanted to reveal that you’re gay? We think it might change how people feel about you.”

The actor said he replied “I really hope you’re not saying this, because I’m not going in the closet for you or anyone. You’ve hired me to be a professional, not to have sex. Being a gay man has nothing to do with my abilities on this show.”

Remembering the exchange, Barrowman said: “The incident was even more offensive because they sent a gay producer to discuss this with me, as if somehow this would ease the blow.”

He has not identified which production company told him to stay in the closet but according to The Times, he has worked for the BBC, ITV and Five as well as the American networks CBS and NBC. All have denied telling him to keep quiet.

Barrowman said he had received an apology over the incident but added: “One of my explicit missions as an entertainer is to work to create a world where no one will ever make a statement like this producer did to me to anyone who’s gay.”