Adrian Edmondson, who is known for starring in anarchic TV comedies The Young Ones and Bottom, is joining the cast of EastEnders.
The comic actor will be seen in the BBC One soap as Daniel Cook, a new love interest for Jean Slater, played by Gillian Wright.
The BBC said Edmondson had already started filming, with his first appearance to air later this summer.
His character is described as "charming and with a wicked sense of humour".
He will be "the perfect antidote for Jean as she continues her treatment for ovarian cancer", producers added.
The 62-year-old actor said in a statement: "There were only 15 boys on my drama course at Manchester Uni, and I'll be the third to appear in EastEnders - so I feel it's a kind of tradition! The other two being Tom Watt [Lofty Holloway] and Paul Bradley [Nigel Bates]."
After breaking through as a stand-up comedian in the 1980s, Edmondson found wider fame playing Vyvyan in The Young Ones and later as the manic Eddie Hitler in Bottom, which he also wrote with co-star Rik Mayall.
Since then, Edmondson has taken on more sedate roles in the likes of Holby City, Bancroft and War and Peace, as well as fronting a series about the Yorkshire Dales for ITV.
He is the latest comedian to move into the soap world, following in the footsteps of the likes of Bradley Walsh, Les Dennis and Vic Reeves.
EastEnders executive producer Jon Sen said: "Adrian's a phenomenal talent who will bring his unique blend of intelligence, warmth and humour to the role of Daniel.
"We're all over the moon he's coming to Walford and can't wait for this love story to hit screens later this year."