The gunman, a 24-year-old Polish citizen, aimed at random people as he drove into the Main Square, a major tourist destination in the center of the city, Krakow police said.