The government said it was working closely with organisers to ensure the Games were free from discrimination.

In Russia, it is illegal to give under-18s information about homosexuality.

'Honest commitment'

In Mr Fry's letter, which was published on his website, he compared the situation to the decision to hold the 1936 games in Nazi Germany.

He urged International Olympics Committee (IOC) President Jacques Rogge and his fellow committee members to "take a firm stance on behalf of the shared humanity it is supposed to represent".

Image caption
North American gay rights activists demonstrated outside the Russian consulate in New York in July

"It is simply not enough to say that gay Olympians may or may not be safe in their village. An absolute ban on the Russian Winter Olympics of 2014 is simply essential," he wrote.

"Stage them elsewhere in Utah, Lillehammer, anywhere you like. At all costs (Russian President Vladimir) Putin cannot be seen to have the approval of the civilised world."

He said the London 2012 Games "were one of the most glorious moments of my life and the life of my country" and a Russian Winter Olympics "would stain the movement forever and wipe away any of that glory".

Mr Fry made a direct appeal to the prime minister at the end of the letter. He says he has the "utmost respect" for Mr Cameron and urged him to act on his instinct.

"As the leader of a party I have for almost all of my life opposed and instinctively disliked, you showed a determined, passionate and clearly honest commitment to LGBT (lesbian, gay, bisexual, and transgender) rights and helped push gay marriage through both houses of our Parliament in the teeth of vehement opposition from so many of your own side," he wrote.

"For that I will always admire you, whatever other differences may lie between us. In the end I believe you know when a thing is wrong or right. Please act on that instinct now."

A government spokeswoman said Mr Cameron outlined concerns about the growing restrictions on LGBT freedoms in Russia to President Putin at a meeting in Downing Street in June.

"We are working closely with the IOC and the BOA (British Olympic Association) to ensure that the Games take place in the spirit of the Olympic Charter and are free from discrimination," she added.

'No patience'

In a statement, the IOC said it "respected Mr Fry's opinion" and the committee was clear that "sport is a human right and should be available to all regardless of race, sex or sexual orientation".

"The IOC has received assurances from the highest level of government in Russia that the legislation will not affect those attending or taking part in the Games," a spokeswoman said.

Image caption
Anti-gay activists and gay rights campaigners both demonstrated outside the Russian parliament in June

In June, Russia passed a law imposing heavy fines for providing information about homosexuality to people under 18.

The law has been criticised by Western politicians and human rights groups, and has raised concerns that visiting gay athletes and spectators could face discrimination or even legal action.

Gay rights campaigners have launched a tentative campaign for a boycott of the Games, due to be held in the Russian Black Sea resort of Sochi in February.

US President Barack Obama spoke out against the legislation on NBC's The Tonight Show, broadcast on Tuesday.

"I have no patience for countries that try to treat gays or lesbians or transgender persons in ways that intimidate them or are harmful to them," he said.

It was in the best interests of Russia to "make sure the Olympics work", he added.

"I think they understand that for most of the countries to participate in the Olympics, we wouldn't tolerate gays and lesbians being treated differently," he said.