Updated

US actor Wentworth Miller has come out as gay in an open letter to Russia in which he rejected an invitation to attend a film festival in protest at the Kremlin's ban on homosexual "propaganda".

The 41-year-old member of the "Prison Break" cast told the Saint Petersburg International Film Festival that he would have loved to have come to the event were it not for the highly controversial legislation.

"Thank you for your kind invitation. As someone who has enjoyed visiting Russia in the past and can also claim a degree of Russian ancestry, it would make me happy to say yes," Miller wrote in a letter posted Wednesday on the website of the pro-gay rights organisation GLAAD.

"However, as a gay man, I must decline," Miller said.

Russian President Vladimir Putin stoked international outrage in June by signing into law a ban on the promotion or display of homosexual behaviour in front of minors.

Rights groups argue that the vaguely worded legislation is discriminatory and several global entertainers have called on countries to boycott the 2014 Winter Olympic Games in Sochi as a result.

"I cannot in good conscience participate in a celebratory occasion hosted by a country where people like myself are being systematically denied their basic right to live and love openly," MIller said.

"Prison Break" aired to great acclaim and mass audiences in the United States between 2005 and 2009. Miller has gone to make other US television appearances and also wrote the screenplay for the 2013 film Stoker.

The head of the Saint Petersburg International Film Festival's selection committee said Miller's letter came as a surprise because the actor had already indicated he would not be coming before Putin enacted the legislation.

"His agency told us (in April), without putting it into writing, that he would probably not be able to come. We took that into account and eventually forgot about it," Alexei Dunayevsky told AFP.

"And then suddenly, today, he sends us an official statement saying that he will not be coming. Why didn't he send it to us in April? Why did he have to send it now?"