You are not permitted to download, save or email this image. Visit image gallery to purchase the image.
Police arrested a 24-year-old man from Montreal early on Sunday morning, Quebec Police Chief Robert Pigeon said at a news conference.
"Dressed in medieval costume and armed with a Japanese sword, everything leads us to believe he chose his victims at random," Pigeon said, adding that preliminary information indicated the man was not affiliated with any terror group.
Pigeon said the suspect had come prepared to inflict as much damage as possible but did not elaborate. Quebec newspaper Le Soleil said the suspect had gasoline containers in his car. Pigeon declined to comment on the report.
The incident began late Saturday night, on Halloween, inside the city's famed walled centre. Police told nearby residents to stay indoors and made an arrest after a three-hour manhunt.
"It is once again, and we believe, an isolated act," Quebec City Mayor Regis Labeaume told reporters. "We need to have a societal debate on the subject (of mental health) because it is becoming more and more difficult to manage."
In 2017, a Canadian man gunned down six members of a Quebec City mosque and was later sentenced to life in prison.
Quebec's police chief said on Sunday that the suspect had spoken of conducting an attack "in a medical context" five years ago but was not known to police and did not have a criminal record.