GDANSK/WARSAW (Reuters) - Pawel Adamowicz, the liberal mayor of the Polish city of Gdansk, died on Monday 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.

Thousands of people gathered in Polish cities to mourn the death of Adamowicz, who had been mayor of Gdansk for 20 years and espoused liberal causes including giving refuge to migrants at odds with Poland’s conservative nationalist government.

“We couldn’t win,” Health Minister Lukasz Szumowski told reporters via private broadcaster TVN. Doctors had operated on Adamowicz for five hours, the state news agency PAP said.

Polish officials said the day of Adamowicz’s funeral would be a national day of mourning.

TV footage showed thousands turning out for commemorative vigils, including in Gdansk, fount of the 1980s Solidarity movement that was instrumental in bringing an end to Communist rule, as well as 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 the 53-year-old 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.

Slideshow ( 11 images )

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 was identified by Polish authorities as a 27-year-old named Stefan, who was released last month from prison where he had served 5-1/2 years for a 2014 conviction for attempted bank robbery. His full name has so far been withheld.

PAP said without citing a source that the man has been treated in prison hospital previously for schizophrenia.

Separately, police tweeted late on Monday that a 72-year-old Warsaw man was detained after threatening in a phone call to a social welfare center that the next in line to be killed was President Andrzej Duda.

The event at which Adamowicz was murdered has raised more than a billion zlotys for charity over 27 years but has been criticized by Poland’s ruling Law and Justice (PiS) party because of its liberal philosophy, including its former motto, “Do what you want”.

“Demons wake up, something terrible happens, with the silent permission of the rulers,” Gerard Projs, a 79-year-old pensioneer, said at the scene of Adamowicz’s death.

Duda, a PiS ally, appealed for unity in the face of violence, saying many Poles were united despite their political differences by “their desire to do good”.

Adamowicz stood out for his initiatives to encourage migrants to seek refuge in the Baltic coast 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 political 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 percent of the vote.