STANLEY Baxter intended to take his secrets to the grave.

But a biography written for posthumous publication has today been released after the 94-year-old star changed his mind.

In The Real Stanley Baxter, the Scottish star speaks openly about his sexuality and relationships for the first time, confirming that he is gay and revealing the truth about his complicated marriage with wife Moira.

The book, written over 20 years by Glasgow journalist Brian Beacom, also confirms that Moira, who suffered from mental illness, ended her own life while Baxter was abroad.

The biography was conceived as a spoiler to an unofficial tell-all Baxter feared would be released and was to be held until after his death before he had a change of heart. It details his beginnings as a child groomed for the stage by his mother and documents his lengthy career on stage and screen via The Stanley Baxter Show, Mr ­Majeika, panto and more.

During that career, Baxter has worked with everyone from Bing Crosbie to Rikki Fulton and Julie Christie to Leslie Phillips, rubbing shoulders with Eartha Kitt and building a fanbase including fellow luminaries like Billy Connolly thanks to comic turns as everyone from ­Tarzan to Liberace and sketches like the much-loved Parliamo Glasgow, which showcased a west of Scotland wit.

But he’s given few interviews over the decades, afraid of what people might think of him. In the foreword, he explains: “Not all my relations with the press in Scotland have been highly satisfying but one relationship has and that’s with the man whom I’ve chosen to write my biography. He not only has my good wishes but my gratitude.

“The process of working on the book over almost 20 years has been enjoyable, except in the difficult areas, but the writer was kind and patient, and in the end, all was revealed.”

Born in Glasgow in 1926, Baxter entertained audiences of up to 20 million people.

But he also turned down opportunities in America, said no to chat shows, rejected sitcoms and even declined a role in Harry Potter. Beacom’s book reveals why, and the lengthy struggle with his sexuality – something he had to hide to avoid arrest and ruin before decriminalisation and that at times led him to consider suicide.

He and close friend Kenneth Williams, who died of an overdose in 1988, are said to have been “united by their loathing of their sexual preference and sense of being trapped”.

“There are many gay people these days who are fairly comfortable with their sexuality, fairly happy with who they are,” Baxter says. “I’m not. I never wanted to be gay. I still don’t.

“The truth is, I don’t really want to be me.”

The book reveals how Baxter disclosed his sexuality to Moira before they wed, and how they remained close despite his relationships with men and women during their marriage. It also tells of Moira’s mental health struggles and her death by overdose, after which it emerged she had not been taking the ­anti-psychotic medication she’d been prescribed.

Baxter reveals the questions he still has, saying: “I’ve often wondered how her life would have turned out had she married a devoted heterosexual husband.”

Beacom says Baxter has “changed a lot” throughout their friendship, becoming more self-accepting, and “had tears in his eyes” when he received a copy of the finished book. Part of that has been through the influence of John Reid, Elton John’s Paisley-born ex-manager and partner. “John has been encouraging Stanley to see people won’t hate him, they will love him,” Beacom says. “He’s learning that.

“Stanley loves the light and the applause. He wanted to switch it back on. He will get attention from this, he will be celebrated.”