MOSCOW — A leading Russian stage and film director, Kirill Serebrennikov, was convicted of embezzling government grant funds Friday in a trial widely denounced as a Kremlin-staged prosecution designed to deter critics of President Vladimir Putin.

But Serebrennikov and the other defendants later walked free after the court suspended his three-year sentence and the sentences for two other defendants. A fourth person convicted in the trial received no punishment.

Supporters who had waited for hours in the heat for the verdict cheered and hugged. “Freedom!” some shouted.

Serebrennikov’s suspended sentence came amid Kremlin sensitivities about an ongoing nationwide vote on constitutional changes that would allow Putin to potentially stay in power until 2036.

A hefty jail term for Serebrennikov could have triggered protests, alienated young voters and distracted from the Kremlin’s efforts to ensure a high voter turnout as part of an effort to lend legitimacy to an extension to Putin’s power. Voting ends Wednesday.

Serebrennikov has often voiced criticism of conservative politicians, the increasingly harsh censorship under Putin and rising authoritarianism. He spoke out for anti-government protests in 2018, has supported LGBTQ rights and criticized the rising influence of the conservative Russian Orthodox Church in political affairs.

Prosecutors at Meshchansky District Court in Moscow had demanded six years in prison for Serebrennikov, five years for producer Alexey Malobrodsky and four years for producer Yuri Itin — all convicted of embezzlement.

Prosecutors also asked for a four-year sentence for art historian and former Culture Ministry employee Sofia Apfelbaum, who was convicted of negligence in handling state funds.

Serebrennikov, 50, is director of Moscow’s Gogol Center and the Seventh Studio theater. Appearing in court, he wore a black mask, dark glasses, a black cap and a gray T-shirt.

He and three other defendants stood trial for the embezzlement of about 133 million rubles (more than $1.8 million) in state funds through the Platforma arts project, which he founded. The four defendants pleaded not guilty, testifying that the funds from the Culture Ministry were used only to stage theatrical productions.

Judge Olesya Mendeleyeva said the Culture Ministry demanded the return of the allegedly embezzled funds.

The judge also fined Serebennikov 800,000 rubles, or about $11,5000. Malobrodsky and Itin were ordered to pay smaller fines. The three were barred from administrative positions in state cultural institutions: Serebrennikov and Itin for three years, and Malobrodsky for two.

“The court believes that the defendants can be reformed without being isolated from society,” the judge said.

Serebrennikov’s lawyer, Dmitry Kharitonov, said he would appeal against the verdict.

Among those who have spoken in Serebrennikov’s defense was one of ballet’s geniuses, Mikhail Baryshnikov, who stated that the director was being persecuted for political reasons.

“An artist of whom Russia should be proud is being debased and humiliated,” he said in a statement when Serebrennikov was called in for questioning in 2017. He said that because Serebrennikov “is a person who is known for his independence and love of freedom, a person who has more than once made brave political declarations, these sudden repressions look particularly foul.”

Baryshnikov defected to Canada in 1974 and holds dual U.S. and Latvian citizenship.

Many Russian actors, directors and cultural figures have spoken out for Serebrennikov since his arrest. More than 3,700 Russian cultural figures signed an open letter Monday to Culture Minister Olga Lyubimova, requesting that the ministry withdraw its charges against the defendants in what is known here as the “Seventh Studio case.”

Russian rapper Miron Fyodorov, who goes by Oxxxymiron, posted Thursday to his 2.1 million Instagram followers, apparently in Serebrennikov’s support, a condemnation of “custom-made lawsuits, the purpose of which is to intimidate freethinking and creative people.”

Hundreds of people gathered outside the court behind police barriers before the verdict was handed down Friday morning.

“I came here to demonstrate my support,” said a protester, Alexander Kuznetsov, 56. “Kirill is not a thief. He is a decent and very talented person. Lots of thieves are in power. Look at the Duma deputies,” he said, referring to lawmakers. “And yet they go after an innocent person.”

Platforma, which staged modern theatrical, dance and musical productions, was an outlet for innovative young artists and directors and was popular among Moscow’s young crowd. It was also a platform for political satire lampooning Russian politicians. But the theater soon became a threat to authorities increasingly intolerant of dissent, activism and liberalism.

“Youth always chooses freedom,” Serebrennikov told the court in his final remarks Monday. He said Platforma “gave artists and audiences a feeling that the ideals of freedom would sooner or later become the foundation of our lives in this country, too.”

Platforma accountants testified that they were ordered to embezzle the funds by the Platforma management. The prosecution said Monday the case against all defendants was proved.

But one key prosecution claim — that a production of “A Midsummer Night’s Dream,” one of the performances for which the grant money was provided, never took place — was false, the defense stated. The production won awards and toured abroad.

Human Rights Watch, PEN America’s Artists At Risk Connection and many international cultural and film organizations Thursday called on prosecutors to drop the charges and free the defendants. They argued that even if there were financial irregularities, these could have been resolved without resort to criminal charges.

Serebrennikov admitted that Platforma’s accounts were sloppy but said he never involved himself in bookkeeping.

“The state’s leap to criminal embezzlement charges seems to be a thinly veiled way to retaliate against Serebrennikov for his political criticism and to send a chilling message to other artists — who have no choice but to accept state funding to survive as artists — to refrain from political criticism,” the Human Rights Watch statement said. “The case is widely considered a specious attempt to punish him for his political candor and artistic nonconformism.”

Under Putin, Russian authorities have mounted increasing attacks on opposition figures, activists, journalists, bloggers and artists, arresting and jailing them, leveling fraud charges and freezing their assets and those of family members.

Putin has made clear his disdain for liberal democracy, telling the Financial Times in an interview last year that liberalism was “obsolete” and was being rejected by millions of people.

Serebrennikov was arrested in 2017 and spent 18 months under house arrest until 2019, when he was released on bail.

Natasha Abbakumova contributed to this report.