Moscow (CNN) -- Three members of Russian female punk rock band Pussy Riot were sentenced to two years in prison Friday after they were found guilty of hooliganism for performing a song critical of President Vladimir Putin in a church.
The five months they have spent in detention since their arrests in March count toward the sentence, Judge Marina Sirovaya said.
The judge said the charges against the three women -- Nadezhda Tolokonnikova, Maria Alyokhina and Yekaterina Samutsevich -- had been proved by witnesses and the facts.
The Pussy Riot members were charged after screaming, "Mother Mary, please drive Putin away," in a protest act in February inside Christ Savior Cathedral, one of Moscow's grandest houses of worship.
Sirovaya rejected the women's defense that they were acting from political motives, ruling that they had intended to insult the Russian Orthodox Church and undermine public order.
However, the fact that two of them have young children was a mitigating factor in the sentencing, the judge said.
The charge of hooliganism aimed at "inciting religious hatred" carried a potential sentence of up to seven years in prison.
The defendants were accused of offending the churchgoers present, through their actions, obscene language and their clothing, and showing a lack of respect for the rules of the Orthodox Church.
They ignored requests to stop their brief unscheduled protest performance, the court heard.
While their actions outraged many of Russia's faithful, their high-profile trial prompted international concern about freedom of speech in Russia.
None of the women is older than 30. They have been in custody since their arrest shortly after the unexpected performance.
Moscow district court heard that the three worked together to carry out their "criminal act which violated public order" -- in an action that "went against tradition and is a great insult to the church and people."
The three wore revealing neon clothing and covered their faces with balaclava-style masks in a style "inappropriate" for a church before making use of a microphone and electric guitar, the court was told.
Video footage of the "punk prayer" protest song was placed online, although the judge said it was not clear who had posted it.
Sirovaya said that the apologies by the defendants "were not sincere" and described their conduct as "an unprecedented act of hooliganism by women."
Evidence from character witnesses for the three women was also read out. Alyokhina was described as being a writer of poetry, a vegan and a good mother, RIA Novosti said.
The three looked calm and occasionally smiled and exchanged remarks as they stood in handcuffs behind a glass wall in the court, listening to the lengthy ruling.
A number of arrests were made outside the court where protesters have gathered, RIA Novosti reported.
Pop star Madonna last week performed Pussy Riot-style in a face mask and with the group's name on her back during a packed Moscow gig.
"Everyone has the right to free speech, everywhere in the world. Maria, Katya, Nadia, I pray for you," Madonna said at Tuesday's concert, according to RIA Novosti. "They did something brave with their action. And I am praying for their freedom."
Rallies have been organized Friday in their support outside Russian embassies around the world, including in London and Washington.
Putin criticized the women's action this month but said they should not be judged "too harshly," RIA Novosti said. He added that he hoped the court makes "the right decision."
Pussy Riot specializes in sudden, often illegal public performances, including one in Moscow's Red Square.
The "punk prayer" was inspired by the women's anger about the relationship between the Russian government and the Orthodox Church, according to the band's manager, who is married to one of the women.
The Orthodox leader Patriarch Kyril has been widely reported as saying Putin's years in power have been a miracle from God.