The attack began shortly before 15:00 local time (14:00 GMT) in Krakow’s Main Market Square, the bustling central point of the city.
Police said a man drove into the square before beginning to fire “at random people from his car”.
Footage from the scene shows scenes of panic as people fled, with the sound of gunfire clearly heard.
Armed officers raced to the scene and engaged in a gunfight with the attacker.
The gunman was shot but is alive and has been arrested.
Distressing footage authenticated by BBC Verify shows the moment a police officer confronts the suspect on the ground before firing his weapon several times.
The officer then falls to the ground, apparently having been injured himself.
City officials have urged people who live in the city and tourists to stay away from the area while an investigation continues.