Thousands of people joined marches across Poland to pay tribute to the centrist mayor of Gdansk who died after he was stabbed in the heart at a charity event.

Pawel Adamowicz died in hospital after a day-long fight by doctors to save him.

"Despite all our efforts, we failed to save him," Doctor Tomasz Stefaniak, director of Gdansk University hospital, told Polish media.

There were marches in a dozen cities around Poland, the PAP news agency reported.

Thousands marched in Gdansk, the Baltic city Adamowicz ran for two decades, many carrying candles or the city's flag.

European Council President Donald Tusk flew in to his hometown to attend the march in memory of his friend and former political ally.

He told the crowd, addressing Mr Adamowicz: "You were always there whenever there was the need to be good and courageous and to take a stand against evil."

Thousands more turned out in the capital Warsaw, where that city's mayor Rafal Trzaskowski spoke to the crowd under a banner reading "Stop the hatred!"

Sunday's attack on Adamowicz, known for his liberal views and opposition to Poland's governing right-wing Law and Justice (PiS) party, has shocked the nation.

Polish President Andrzej Duda honoured the "great politician" and announced a day of national mourning to coincide with Adamowicz's funeral, the date of which has yet to be decided.

The European Parliament held a minute of silence.

European Commission President Jean-Claude Juncker expressed "great sadness" in a message on Twitter, offering "deepest condolences" from the organisation.

"Goodbye Pawel, we'll remember you," Lech Walesa, Poland's legendary anti-communist leader and another native of Gdansk, said on Twitter.

The doctors who battled to save him in surgery said the 53-year-old had suffered a serious wound to the heart and cuts to his diaphragm and abdominal organs.

Video footage showed the attacker, who police said was wearing a press badge, bursting on to the stage and launching himself at Mr Adamowicz, as the mayor stood with others waving sparklers towards the end of the fundraiser.

After attacking the mayor, the man turned to the crowd with his arms raised triumphantly before being tackled to the ground by security guards and arrested.

'Spiral of violence'

Paramedics resuscitated Mr Adamowicz at the scene before bringing him to the hospital.

Gdansk residents rushed to blood donation centres following news that Mr Adamowicz had received 15 litres (32 pints) of blood and required more of the rare O Rh- type.

"We will miss him a lot," Agnieszka Naruszewicz told AFP, describing the late mayor as "kind, friendly, smiling".

"The spiral of violence has gone too far in Poland," the teacher added.

"It's shocking that something like this could happen in Gdansk," another city resident, office worker Maciej Szczepanski, said.

Prosecutors have charged a 27-year-old male suspect with murder. They said the man had not confessed and he would undergo a psychological assessment due to "doubts about his sanity". If convicted, he could face a life sentence in prison.

In a video recording of the attack posted on YouTube, the suspect was seen seizing the microphone and claiming he had been wrongly jailed by the previous centrist government of the Civic Platform (PO) party and tortured.

"That's why Adamowicz dies," he said.

One witness told broadcaster TVN that the man appeared "happy with what he had done".

Mayor for two decades

Mr Adamowicz had been mayor of Gdansk for two decades. The city of around half a million people was the cradle of Poland's anti-communist Solidarity movement in the 1980s.

The opposition PO, the arch-rival of the governing PiS, backed his re-election in the 2018 municipal polls and he won with 64% of the vote.

The attacker had previously been sentenced to more than five years in prison for four armed attacks on banks in Gdansk, justice officials said.

Police were investigating how the suspect had been able to breach security to reach the podium.

"We have to establish how (the suspect's press badge) was obtained, was the accreditation in his name and was he really entitled to be there?" local police spokeswoman Joanna Kowalik-Kosinska told reporters.

This type of attack is rare in Poland. A similar incident occurred in 2010 when an assailant gunned down an aide at a regional PiS office before stabbing another PiS employee, who survived.