A man holds a candle at the main square in Kraków, Poland, on Sunday, after a gun attack in which six people were killed.Photograph: Beata Zawrzel/AP

A gunman suspected of killing six people in a popular market square in Kraków has died in hospital, Polish police said early on Monday.

The suspect, a 24-year-old named in local media as Michal O who authorities say was probably inspired by far-right ideologies, had been wounded in a shootout with police and had been in critical condition in hospital.