A knife-wielding assailant on Sunday stabbed the mayor of the Polish port city of Gdansk in front of hundreds of people at a charity event, police and media said.
Paramedics resuscitated Pawel Adamowicz, 53, at the scene before taking him to hospital where he underwent surgery.
"I learned that doctors succeeded in re-establishing the cardiac function of Mr Adamowicz who has been gravely wounded. There is hope but his condition remains serious," Polish President Andrzej Duda said on Twitter.
A video recording of the attack posted on YouTube showed the attacker bursting onto the podium.
After knifing the mayor, he seized the microphone and claimed to have been wrongly jailed by the previous centrist government of the Civic Platform (PO) and tortured.
"That's why Adamowicz dies," the attacker said.
The Civic Platform had supported Adamowicz's re-election in 2018 municipal elections.
The attack took place at a fundraiser for the purchase of medical equipment and the assailant was quickly apprehended by security guards and arrested.
A Gdansk police spokesman said the detained man was a 27-year-old who lived in the city.
According to Polish media, the man had been sentenced to more than five years in prison for four armed attacks on banks in Gdansk.
"The attack on the life and health of the mayor of Gdansk must be firmly condemned," Polish Prime Minister Mateusz Morawiecki said on Twitter.
Interior Minister Joachim Brudzinski condemned the attack as "an incomprehensible act of barbarism".