Pawel Adamowicz underwent five hours of surgery for wounds to his heart and internal organs after being attacked on Sunday evening.

The 53-year-old was allegedly attacked by an ex-convict who shouted that it was revenge against the politician’s previous political party.

Adamowicz — who has been the city’s mayor for more than 20 years — clutched his stomach and collapsed in front of the audience at the highly popular annual fundraiser organised by the Great Orchestra of Christmas Charity.

The assailant shouted from the stage to say he had been wrongly imprisoned under a previous government led by Civic Platform, a party which the mayor formerly belonged. He said his name was Stefan and said: “I was jailed but innocent ... Civic Platform tortured me. That’s why Adamowicz just died.”

Polish mayor dies after being stabbed on stage at charity concert Show all 10 1 /10 Polish mayor dies after being stabbed on stage at charity concert Polish mayor dies after being stabbed on stage at charity concert Security staff trying to stop a man after he attacked Mayor of Gdansk, Pawel Adamowicz, during the 27th finale of the Great Orchestra of Christmas Charity in Poland AFP/Getty/East News Polish mayor dies after being stabbed on stage at charity concert Gdansk's Mayor Pawel Adamowicz speaking at the concert before he was attacked. He has been the city’s mayor for more than 20 years Reuters/Agencja Gazeta Polish mayor dies after being stabbed on stage at charity concert The attacker stood on the stage holding a knife just after he stabbed Gdansk's Mayor. He is allegedly an ex-convict who shouted that it was revenge against the politician’s previous political party Reuters/KFP Polish mayor dies after being stabbed on stage at charity concert Adamowicz was attacked with a sharp instrument by a 27-year-old male during the concert Reuters Polish mayor dies after being stabbed on stage at charity concert The assailant shouted his name was Stefan and said: “I was jailed but innocent. ... Civic Platform tortured me. That’s why Adamowicz just died.” EPA Polish mayor dies after being stabbed on stage at charity concert The mayor died in hospital after undergoing five hours of surgery for wounds to his heart and internal organs AFP/Getty/East News Polish mayor dies after being stabbed on stage at charity concert He was taken to the university hospital in the Baltic port city, but despite the five-hour operation his life could not be saved EPA/Adam Warzawa Polish mayor dies after being stabbed on stage at charity concert A doctor gives an update on the mayor's condition. Police said the suspect, a 27-year-old Gdansk resident who was recently released from prison where he had served a term for bank robberies, has been detained and is awaiting questioning by prosecutors. A police spokesman, Mariusz Ciarka, said the attacker appeared to have mental problems and gained access to the area with a media badge. Police were checking if it was authentic and how he got hold of it. Reuters/Agencja Gazeta Polish mayor dies after being stabbed on stage at charity concert Adamowicz was part of the democratic opposition formed in Gdansk under the leadership of Lech Walesa during the 1980s. After leaving Civic Platform, he was re-elected to a sixth term as an independent candidate in autumn. As mayor, he has been a progressive voice, supporting LGBT rights and tolerance for minorities. He showed solidarity with the Jewish community when Gdansk synagogue had its windows broken last year, strongly denouncing the vandalism EPA Polish mayor dies after being stabbed on stage at charity concert People waited to donate blood for Gdansk's mayor at a local blood donation station AFP/Getty/KFP

Adamowicz was taken to the university hospital in the Baltic port city, but despite the five-hour operation his life could not be saved.

“We couldn’t win,” said Poland’s health minister Lukasz Szumowski, according to private broadcaster TVN.

The Gdansk city flag has been lowered to half-staff at the news of the death.

The attack triggered an outpouring of solidarity, with many people donating blood in Gdansk on Monday. Some said they were given time off work to help save Adamowicz.

Police said the suspect, a 27-year-old Gdansk resident who was recently released from prison where he had served a term for bank robberies, has been detained and is awaiting questioning by prosecutors.

He previously facing charges of attempted murder, but if convicted of murder he could face up to life in prison.

A police spokesman, Mariusz Ciarka, said the attacker appeared to have mental problems and gained access to the area with a media badge. Police were checking if it was authentic and how he got hold of it.

Politicians across the political spectrum in Poland condemned the stabbing, including members of the ruling nationalist Law and Justice Party (PiS), such as prime minister Mateusz Morawiecki and interior minister Joachim Brudzinski.

“I’m expressing great pain for the tragic death due to the criminal attack on mayor Pawel Adamowicz. We express solidarity with his family,” Jaroslaw Kaczynski, PiS’s party leader was quoted as saying in a tweet from the party spokeswoman.

Support free-thinking journalism and attend Independent events

Adamowicz was part of the democratic opposition formed in Gdansk under the leadership of Lech Walesa during the 1980s.

After leaving Civic Platform, he was re-elected to a sixth term as an independent candidate last autumn.