Actor-screenwriter Wentworth Miller publicly came out gay on Wednesday in the course of declining an invitation to attend a film festival in Russia.

“As a gay man, I must decline,” Miller wrote in a letter to the St. Petersburg International Film Festival.

“I am deeply troubled by the current attitude toward and treatment of gay men and women by the Russian government. The situation is in no way acceptable, and I cannot in good conscience participate in a celebratory occasion hosted by a country where people like myself are being systematically denied their basic rights to live and love openly.”

“Perhaps, when and if the circumstances improve, I'll be free to make a different choice,” he added.

Miller, 41, came to prominence following his role as Michael Scofield in Fox's Prison Break.

St. Petersburg since last year has had an ordinance prohibiting “gay propaganda” to minors. In June, the federal government adopted a similar measure, setting off a worldwide outcry and calls for a boycott of next year's Winter Olympics to be held in Sochi.