Bob Mortimer was in such danger before his triple heart bypass surgery that he was granted special permission to marry just hours before the procedure.
The comedian, who is one half of double act Reeves and Mortimer, was told last autumn that his arteries were 95% blocked.
He wed his partner of 22 years Lisa Matthews on the morning of the operation.
He said: "I found out on the Thursday that I needed surgery, so I made a will on the Friday.
"I found out I couldn't get married to Lisa because you have to give 21 days' notice or something.
"My consultant said I was incredibly ill, so the registrar in London gave me permission to get married on the Monday.
"So I got married at 9.30am on the Monday, and went to hospital at 10am to have my operation."
The only guests at the wedding were the couple's two children, Harry and Tom, so Mortimer's comedy partner Vic Reeves did not get a chance to be his best man.