The gig was sold out and the ­audience had paid to see Johnny Vegas, the drunken, ranting, sharp-as-a-knife comedian they knew from years of live shows and TV.

But backstage at the Edinburgh Festival, Johnny refused to be conjured up.

The man in the dressing room was still Michael Pennington, the quiet, thoughtful and gently witty real guy behind the star’s slurring bravado.

Michael needed alcohol, and lots of it, to transform himself.

“I had to drink to get Johnny up to ranting pace,” he explains.

But he was low on booze and short of cash so it was the stone-cold-sober Michael who walked out when fellow comic Eddie Izzard welcomed him to the stage.

He was still willing Johnny Vegas to emerge and save the show – but without alcohol it just didn’t work.

Several minutes of excruciating silence followed as his act fell horrendously flat.

Michael admits in his new autobiography, Becoming Johnny Vegas, that in 17 years of being Johnny, booze played a huge part.

At one stage he was drinking two bottles of vodka a day.

He describes his creation as both a blessing and a curse and even talks about him in the third person.

“Drink would encourage Johnny out and that was the only time my fear of stand-up went away,” says Michael, 42

“I am very proud of what Johnny achieved in stand-up comedy because he believed entirely in giving an audience the best kick he could.

"But he was someone who was quite detrimental to my health, both emotionally and physically.”

Now much more sober and few stones lighter, he explains why he wrote the book.

Origins: the young Johnny Vegas, AKA Michael Pennington

“I wanted to try and trace the genuine origins of Johnny and how he so successfully staged this takeover of Michael Pennington,” he reveals.

“Johnny is a contradiction to who I am as a person. I’m not very good at confrontation. I have a tendency to internalise and to carry things around.

“Johnny was a coping mechanism who could take those things which could have destroyed me, by tweaking my past and throwing it back out there, getting laughs from things that would have otherwise upset me.”

Brought up in a strict Roman Catholic home in St Helens, Lancs, 11-year-old Michael was sent to train as a priest at a cold, unloving seminary.

During his time there an older boy made sexual advances, leaving him feeling completely ashamed.

“I came from a very loving home, had a happy life with no great ­aspirations, but going to the seminary changed me. There was a chunk of my childhood missing,” he says. “Once I’d realised it wasn’t for me I still felt a tremendous pressure to continue for fear of letting everybody down.”

He lasted 18 months and when he finally went back to a regular school he found he didn’t fit in.

“I felt like a 30-year-old trapped in the body of a 13-year-old because I’d been away and done so much.

"And there was a stigma having been to train for the priesthood.”

When bullies threatened him his first, counter-productive, tactic was to say he’d pray for them.

Then the first signs of Johnny appeared, giving him the back-up he needed to survive.

His alter ego didn’t care what other people thought.

Michael was also a hypochondriac, thinking he had every ailment from lockjaw to cancer, but Johnny Vegas was fearless.

“What would stop it was alcohol. But you can’t stay drunk the whole time to stop yourself worrying,” says Michael.

Priorities: Johnny and his son Michael Pennington Jr (Image: Getty)

He still doesn’t know how much Guinness and vodka he drank during his stand-up days or when he was nominated for the Edinburgh Festival’s Perrier Award in 1997, or on his sell-out tours.

“Johnny had a theory that if you counted how much you were drinking, you weren’t enjoying it.

“He never kept track but he could go on drinking for hours. I was ill with nerves before going on.

"As Michael Pennington I’d build up during the day, hoping to coax Johnny out of his box.”

It was the birth of his son, Michael Jr, now 10, from his first marriage to Kitty Donnelly, that made Michael want to take control again.

“I thought, ‘My son doesn’t deserve Johnny Vegas as a dad’. I didn’t want him thinking that was the norm. It was the start of a hard battle.”

So he built a new career which didn’t involve getting drunk, branching out from stand-up into award-winning acting roles in the BBC’s Dickens drama Bleak House and the sitcoms Benidorm and Ideal, as well as starring with a knitted monkey in ads for ITV Digital and PG Tips.

Now he’s working as a writer and director and is happy behind the camera. “It’s more of a job for Michael Pennington,” he says.

He also hopes to get back into ceramics. He studied to be a potter in his youth and his work is on show at the Victoria & Albert Museum in London.

In 2011 Michael married for a second time. TV producer Maia Dunphy, 37, has helped him keep the lid on Johnny Vegas.

“She has made a huge difference,” he says. “I don’t feel like I’m searching for things any more. She’s managed to identify areas where Johnny was still lurking.

“Johnny would get easily distracted by friends who’d say, ‘We’ll just go for one drink’ and it would turn into five.

“Now that doesn’t happen. I have a good social life but most weekends I’ve got my son and my socialising is limited to me and my wife or family parties.”

His time is now divided between Dublin, where Maia lives, London, where his son lives, and St Helens.

“I commute to Dublin and she commutes to St Helens. Half my life is spent running for a flight or a train,” he says.

Happy couple: Johnny Vegas and second wife Maia Dunphy (Image: Getty)

One outcome of writing his auto­biography is a forthcoming reunion with his former English teacher.

In the book he confesses how he used to fantasise about her in his teens.

“She is coming to a book reading in St Helens,” he says. “I can’t wait to see her again but it’s embarrassing. She’s read all those pages.

“I had very detailed fantasies about how she used to mark my homework on a barge with candles and a glass of red wine while fantasising about me, ‘One day he will be old enough and I will whisk him away to Paris.’

"I think she recognised there was potential in me and wouldn’t let go of it, which I misconstrued as her flirting.

“She was very funny. One of my reports said ‘Michael must learn to shut up if I am to preserve my sanity.’? ”

So will Johnny Vegas ever re-emerge?

“I kind of miss him. He is always pacing around up there,” says Michael, pointing to his head.

“He is dying to get out and show the young comics of today how it’s done.

“I’ve been offered all the reality TV shows but have turned them down. If I did it as Johnny, there’d be no jungle left!

“It was really hard regaining control of myself so I am reluctant to let Johnny back out of the box.”

Hinting that he may one day perform under his real name, he says: “I wonder if I could be brave enough to do stand-up as Michael as opposed to Johnny because he is a hard act to follow?

“But for my own peace of mind I would have to say he will not be coming out in the immediate future.

“I don’t know if I shall ever let that genie out of the bottle again.”

Becoming Johnny Vegas by Johnny Vegas is published by HarperCollins at £20.