Police initially arrested two men but later said just one, Alexandre Bissonnette, remained a suspect.
A second person held in connection with the shooting was later described as a witness. One man was arrested at the scene and a second man held after he called 911, police said.
A handgun and at least two assault rifles were also recovered, according to Canadian media reports.
Bissonnette is a French-Canadian student, according to local news website TVA, which cited police sources. A Facebook page reportedly belonging to Bissonnette included “likes” for Donald Trump and Marine Le Pen, the far-right French presidential candidate.
The suspect has made a brief court appearance at which he did not enter a plea. He stared at his feet and fidgeted during the hearing as he appeared in a white prisoner jumpsuit. His next court date is February 21.