Pawel Adamowicz, the liberal mayor of the Polish city of Gdansk, has died of his wounds a day after being stabbed by a former convict who rushed the stage during one of Poland's biggest annual charity events.
"We couldn't win," Poland's health minister Lukasz Szumowski told reporters via private broadcaster TVN on Monday.
Doctors had operated on Adamowicz for five hours, state news agency PAP said.
Polish officials said the day of Adamowicz's funeral would be a national day of mourning.
Television footage showed thousands of people gathering for commemorative vigils across the country on Monday, including in the cities of Gdansk, Poznan and the capital Warsaw.
Adamowicz was attacked while attending the annual Great Orchestra of Christmas Charity, which raises money for medical equipment in hospitals. The head of the charity resigned soon after Adamowicz's death was announced.
Television footage of the attack showed a man screaming "Adamowicz is dead!" as he rushed the stage and stabbed the mayor, who crumpled to the floor.
Speaking on the stage before he was arrested, the attacker accused the mayor's former party of putting him in prison, where he said he was tortured.
The attacker has been identified by Polish authorities as a 27-year-old named Stefan, who was released last month from prison where he had been serving 5-1/2 years for a 2014 conviction for attempted bank robbery. His full name has so far been withheld.
Psychiatrists will assess if the attacker can be held criminally responsible for his actions, prosecutor Krzysztof Sierak told a news conference.
The event at which Adamowicz was murdered has raised more than a billion zlotys for charity over 27 years but has been criticised by Poland's conservative ruling Law and Justice (PiS) party because of the liberal philosophy it espouses.
Poland's President Andrzej Duda, a PiS ally, urged unity in the face of violence, saying many Poles were united despite their political differences by "their desire to do good".
PiS Prime Minister Mateusz Morawiecki and Interior Minister Joachim Brudzinski and opposition politicians condemned the stabbing. Adamowicz was an outspoken opponent of PiS.
Adamowicz stood out for his initiatives to encourage migrants to seek refuge in the northern Polish city, and for his support of a protest campaign to defend the rule of law in Poland against what activists consider efforts by the PiS to increase its control over the judiciary and other bodies.
Adamowicz was one of Poland's longest-serving mayors, holding his position in Gdansk since 1998. In the 2018 regional election, he won 65 per cent of votes.