MOSCOW — An activist from the punk collective Pussy Riot has been sentenced to 40 hours of community service for a protest outside the headquarters of Russia’s top KGB successor agency.

A Moscow court ruled Thursday that Maria Alekhina violated the law with her unsanctioned picket, a verdict she said she would appeal.

Alekhina was detained Wednesday after unfurling a banner that read “Happy Birthday, Hangmen!” outside the headquarters of the Federal Security Service, or FSB, Russia’s main domestic security agency. Her action coincided with a day honoring the agency’s employees, which falls on the anniversary of the creation of the Bolshevik secret police, the Cheka.

Alekhina and Pussy Riot bandmate Nadezhda Tolokonnikova spent nearly two years in prison for an anti-Putin protest inside Moscow’s Cathedral of Christ the Savior in 2012.