Mr Mark Oaten, former leadership contender for Britain's Liberal Democrat Party, resigned on Saturday as the party's Home Affairs spokesman over revelations the married father-of-two had a sexual relationship with a man.
Oaten, who quit the leadership race on Thursday after failing to win backing from his parliamentary colleagues, resigned his post after being confronted with evidence of the lengthy homosexual relationship by the News of the World.
"The Liberal Democrat Home Affairs spokesman has resigned this evening after the News of the World confronted him over a relationship with a rent boy," the newspaper, which planned to publish the details in Sunday's editions, said in a statement.
Mr Oaten confirmed his resignation and apologised for his behaviour.
"I have stood down as Home Affairs spokesman for the party," he said in a statement.
"I would like to apologise for errors of judgement in my personal behaviour and for the embarrassment caused firstly to my family but also to my friends, my constituents and my party. I will not be commenting further at this time," he added.
Liberal Democrat Chief Whip Mr Andrew Stunell confirmed the resignation had taken place with immediate effect and appealed for Oaten and his family to be left in peace.
Mr Oaten has broken no law, and whether he remains in politics after the revelations will be up to his constituency party.
It is the latest scandal to rock the small left of centre party after its leader Mr Charles Kennedy resigned his post two weeks ago after growing pressure from within the party forced him to admit he was an alcoholic.
Mr Oaten said he had stood for the leadership because he had a "vision" for the future and had received strong support from activists and Liberal Democrat members around the country.
Three other contenders remain in the race to lead Britain's second-largest opposition party: LibDem deputy leader Sir Menzies Campbell; party president Mr Simon Hughes and economic spokesman Mr Chris Huhne.
Nominations for the race close on January 25, with the more than 70,000 party members voting from February 6 until March 1.
The winner will be named on March 2, the day before the party's annual spring conference.