Vladimir Putin reacted angrily to the German chancellor Angela Merkel's questioning of the two-year jail sentence for the anti-Kremlin punk band Pussy Riot on Friday, telling her that a member the group had once committed an anti-Semitic act.

Speaking about the band's performance in a Moscow cathedral, Merkel said the protest would have "generated a debate about whether that should go on in a church, no question".

But during public talks with the Russian president before the two retreated for closed-door talks she questioned the sentences they received. "Should you really have to spend two years in a labour camp for it, I don't know. In any case that would not have happened in Germany."

Putin retorted sharply by saying: "We hear what our partners say. But do they, being so far away, hear about what's going on?"

"Mrs Chancellor spoke about the girls jailed for their performance in a church. Does she know that one of them had hanged a Jew in effigy and said that Moscow should be rid of such people?" Putin asked. "Neither we, nor you, can support people who assume an anti-Semitic position," said Putin, who served as a KGB agent in East Germany in the 1980s. "I ask you to keep that in mind."

Putin has repeatedly supported the sentence against Pussy Riot. Three of the band's members – Maria Alyokhina, Nadia Tolokonnikova, and Yekaterina Samutsevich – were sentenced to two years in prison in August for singing an anti-Putin "punk prayer" inside a Moscow cathedral. Samutsevich was later given a suspended sentence and released.

The Russian president appeared to be referring to a September 2008 performance by the radical art group Voina, of which Tolokonnikova and Samutsevich were once a part. The group staged a mock hanging of five men in a Moscow supermarket as commentary on the city's repressive social policies.

"In the light of day, in the lighting department, three migrant workers and two homosexuals, one of whom was also a Jew, were killed by hanging," a description of the performance reads. Moscow has been criticised for failing to protect its many migrant workers from ex-Soviet states, who face regular violence, and has banned gay pride parades for 100 years. Video of the performance shows Tolokonnikova and Samutsevich in the group.

Merkel is the first western leader to visit Putin since his contentious return to the presidency earlier this year. The Russian leader's reputation has plummeted abroad amid a growing crackdown on opposition groups.

The German parliament has urged Merkel to take a tougher stance with Russia. Speaking to the press following talks with Putin, Merkel said she had raised concerns over a series of new laws. Critics have called out new harsh laws on treason, nongovernmental organisations and the internet.

Merkel and Putin have long had a contentious relationship, unlike Putin's chummy ties with former chancellor Gerhard Schroeder, who joined Nord Stream, a Gazprom-led pipeline project, upon leaving office in 2005.

Merkel appeared to urge Putin to take criticism more lightly: "If I were offended every time I was criticised, I wouldn't last three days as chancellor".

• This article was amended on 19 November 2012 to correct a quote from Angela Merkel about the sentencing of Pussy Riot members.