MONTREAL — A former university student who killed six men at a mosque in Quebec City early last year pleaded guilty to first-degree murder on Wednesday, hastening the conclusion of a case that shocked Canadians and underscored the presence of Islamophobia in multicultural Canada.

“I’ve thought about this a long time. In my heart, this is the decision I’ve made,” the gunman, Alexandre Bissonnette, 28, told a Quebec City courtroom, after previously pleading not guilty.

Several of the victims’ family members sobbed openly in court after the judge read out the names of the six men killed in the attack, in which five others were seriously wounded, according to Mohamed Labidi, the president of the mosque, the Islamic Cultural Center of Quebec, who attended the proceedings.

Among those in attendance was Aymen Derbali, who was left paralyzed after being shot seven times when he tried to distract Mr. Bissonnette by staring directly at him so he would stop shooting others. The gunman’s parents were also in court as their son read out his guilty plea.