Pawel Adamowicz, the mayor of Gdansk, had been on stage at the Light to Heaven charity event when he was attacked.
According to eyewitnesses, Adamowicz, 53, was attacked while he was on stage for the finale of the charity concert.
He reportedly shouted that he had been wrongfully imprisoned under the previous government, led by the mayor's former party.
Gdansk Mayor Pawel Adamowicz grabbed his belly and collapsed after being stabbed in the abdomen multiple times in front of the audience.
Gdansk is one of Poland's largest cities, on the country's Baltic coast, with a population of around 570,000.
Doctors resuscitated Adamowicz on the spot and then transported him to Medical University of Gdansk, where he underwent five hours of surgery, said Dr. Tomasz Stefaniak.
Police were investigating how the attacker had been able to breach security to reach the podium, Gdansk police spokesperson Joanna Kowalik-Kosinska told reporters.
Polish Prime Minister Mateusz Morawiecki condemned the attack on Twitter and Interior Minister Joachim Brudzinski called it "an incomprehensible act of barbarism".
He was part of the democratic opposition born in the city under the leadership of Lech Walesa during the 1980s which helped to bring down the Communist regime. "Pawel, we are with you".
He is seen as a progressive voice and has supported LGBT rights and tolerance for minorities.
He also showed solidarity with the Jewish community when the city's synagogue had its windows broken past year, strongly denouncing the vandalism.
Adamowicz has been mayor of Gdansk for two decades and the Civic Platform had supported his re-election in 2018 municipal polls.
Radio Gdansk reported that Adamowicz was stabbed in the area of his heart, but did not cite its source, while Rzeczpospolita described his condition as "critical", citing unnamed sources.
"That's why Adamowicz dies", the attacker said.
Acknowledging that they've had political differences with Adamowicz, President Andrzej Duda said that "today I am unconditionally with him and his loved ones, just as I hope all of us compatriots are".
The stabbing, during an event that raises money for children's hospitals, has shocked Poland, the BBC's correspondent in Warsaw said.