“Our God-loving forefathers, who built churches and monasteries, did not do this just for prayer,” Mr. Zhelyezov said. “They put in their spiritual foundation, so that the Russian people, we and you, have immunity. So that we could stand, fight with our external enemies, our internal enemies.”

Although Mr. Putin said last week that he hoped the women were “not judged too severely” by the court, Patriarch Kirill has been unusually quiet in recent days, allowing other conservative voices in the church to press for a guilty verdict and for punishment harsh enough to discourage similar actions.

While church officials have stressed that they cannot interfere in the legal process of the trial, the patriarch set the tone in April when he led a prayer service outside the cathedral, saying the church was under attack and had to defend itself.

A spokesman has said Patriarch Kirill will comment at the end of the trial. The defendants were allowed to make final statements on Wednesday, and the judge said she would issue her verdict on Aug. 17.

The defendants, who have seemed exhausted at times during the trial, appeared heartened by Madonna’s support. One, Nadezhda Tolokonnikova, told the judge that she believed even many church members had changed their minds.

“I know that many Orthodox Christians support us now. In fact, they pray for us,” she said, seeming to fight back tears. “Madonna held a performance yesterday,” she continued. “She performed with a Pussy Riot sign on her back. More and more people are seeing that we are being held here illegally and under a completely false accusation.”

But just as the trial has created an opportunity for celebrity musicians and Mr. Putin’s opponents to rally in support of the band, the episode has emboldened some of the church’s more doctrinaire adherents.