Angus Deayton is to appear in a BBC sitcom a year after being sacked by the corporation over revelations about his private life.
Deayton was dismissed in October last year
Deayton will play a beleaguered doctor called Don in Nighty Night, a black comedy written and starring Julia Davis.
Made by Steve Coogan's production company Baby Cow, the series will be shown in the autumn - firstly on digital channel BBC Three and later on BBC Two.
Deatyon was fired from presenting Have I Got News For You in October last year following a flurry of tabloid stories about his personal life.
A number of one-off presenters, including Bruce Forsyth and Charlotte Church, have stood in for him while producers try to find a permanent replacement.
Davis appeared with Rob Brydon in Human Remains
Since his departure Deayton has been back on BBC screens twice - presenting the Christmas special of Before They Were Famous and a Comic Relief version of University Challenge.
He already has a sitcom pedigree from his days playing Victor Meldrew's dour next-door neighbour Patrick in BBC One's One Foot in the Grave.
Nighty Night, described as a West Country version of Fatal Attraction, features Davis as 20-something widow Jill Farrell, co-owner of a suburban beauty salon, who is obsessed with Deayton's character.
Davis co-wrote and starred in BBC Two's award-winning Human Remains alongside Rob Brydon.
Nighty Night also stars Kevin Eldon, Rebecca Front and Jeremy Swift.
Coogan's Baby Cow company has also produced comedies Marion and Geoff, Paul and Pauline Calf and Cruise of The Gods.