Former London mayor Ken Livingstone has criticised the BBC for allowing Boris Johnson to appear in a guest role in an episode of EastEnders.
Mr Livingstone said he was turned down twice by the show, including in 2006 when he wanted to promote recycling.
He said: "They told me it wouldn't be right to have a politician on a soap."
Mr Johnson defended his cameo, which was aired on BBC One on Thursday, saying it was his job to "promote" arts, culture and media sectors.
In the episode the mayor, who played himself, met the landlady of the show's Queen Vic pub, Peggy Mitchell, played by Barbara Windsor.
The scene came after Peggy, who recently became involved in local politics, endured a frustrating time trying to track the mayor down. It was filmed in July.
Clearly things have changed. I've never had any doubts they were keen on him [Boris Johnson]
Mr Livingstone said his staff had first approached the BBC's show in 1985-86.
"Back in 1985-86 when EastEnders started my staff approached them for a cameo, but it was turned down.
"They said it wouldn't be right to have a politician on a soap."
His next attempt was in 2006-07 when he was the mayor and wanted posters of a recycling campaign on the set.
"They [The BBC] said it wouldn't be appropriate, that it was political.
"Clearly things have changed. I've never had any doubts they were keen on him [Boris Johnson]."
Defending his cameo, Mr Johnson said: "To those who say it is not much of a matter to appear with Barbara Windsor, she is a landmark of our culture.
"The arts, culture and media sectors in this city generate about £9bn, it is my job promote them just as much as anything else."
'Coup for Boris'
Criticising the BBC, Murad Qureshi, a Labour member of the London Assembly, said: "The BBC should always be even-handed and consistent when dealing with political figures, not turning down some and promoting others.
"It's a coup for Boris, being portrayed as pretty straight guy on such a popular show.
"But I would question whether it's in the BBC's remit to influence the public's perception in this way."
A BBC spokeswoman said: "Boris Johnson made a cameo appearance in EastEnders as part of the storyline where Peggy Mitchell stands as an independent candidate in a fictional local election.
"His appearance is compatible both with BBC Editorial Guidelines and the principle of due impartiality."
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.