Thousands of people have gathered in Montreal to mourn and honour the memory of three of the six Muslim men who were killed as they prayed at a mosque in Quebec City on Sunday evening.

The families of Khaled Belkacemi, Abdelkrim Hassane and Aboubaker Thabti were joined by members of the public, Muslim religious leaders, and political figures in Quebec, during a public funeral service on Thursday afternoon.

Belkacemi, Hassane and Thabti’s caskets were on display at the Maurice Richard Arena in Montreal, draped in the flags of Tunisia and Algeria, the men’s countries of origin. Their bodies will be repatriated to their home countries for burial.

"We are here together to mourn the loss of Canadians who tragically left us last Sunday. They leave behind beloved families, friends, colleagues, and a sense of emptiness in this country," said Chayma BenHaj, who presided over the funeral.

Quebec mosque shooting puts islamophobia in focus

"Through death, these brave men … united people from different nationalities, colours, genders and religions. They united all of Canada. Today, it is with solidarity, compassion, and love that we cry the loss of these fathers," BenHaj said.

Thabti, Hassane and Belkacemi were killed when a gunman opened fire in a prayer room at the Islamic Cultural Centre in Quebec City on Sunday. In total, six men were killed, and more than eight others were seriously injured in the attack.

Originally from Tunisia, Thabti, 44, was a pharmacist and the father of two young children.

"Let's build our Quebec together," said Mohamed Yangui, president of the mosque where the shooting took place.

Hassane, 41, was from Algeria, and had three young daughters. “I lost a husband, a father and a friend,” Hassane’s wife, Louiza, told Radio-Canada.

OPINION: Why the Quebec mosque shooting happened

Also from Algeria, Belkacemi, 60, was a professor at the Université de Laval in Quebec City. “Together, we will overcome hatred and ignorance. My father will not have died in vain,” his son, Amir, posted on Facebook earlier this week.

Canadian Prime Minister Justin Trudeau, Quebec Premier Philippe Couillard, and Quebec City Mayor Regis Labeaume, were among the many political figures who attended the funeral.

Tributes paid to Quebec shooting victims

"Our country was united and showed solidarity with a community whose pride and strength is unshakeable, despite the atrocities that afflicted them so unjustly. This afternoon, it is an entire country that is joining the families of the victims," Trudeau said.

"As a community, and as a country, together, we will rise from this darkness stronger, more unified, than ever before. Because that is who we are."

Denis Coderre, Montreal mayor, said: "We are all brothers and sisters. We are all in mourning."

Funeral services will also be held on Friday in Quebec City for the other three men killed in the attack: Mamadou Tanou Barry and Ibrahima Barry, both from Guinea, and Azzedine Soufiane, who is originally from Morocco.

"We are in mourning," Souleymane Bah, president of the Guinean Association of Quebec, told Al Jazeera.

OPINION: Quebec mosque shooting - Beyond the official rhetoric

Bah said Mamadou Tanou Barry will be buried in Montreal on Sunday, while Ibrahima Barry will be repatriated to Guinea for burial.

"Ibrahima Barry was very devoted, a leader," Bah said. "They were very sympathetic people … who were well integrated, who were working, who were calm, and had a sense of faith."

Soufiane, 57, owned a halal grocery store and butcher’s shop, and he was the father of three children. He had lived in Quebec City for decades and served as a leader and confidante for members of the local Muslim community.

“He was a calm and kind person," Rachid Ben-Amor, one of Soufiane’s close friends, told Al Jazeera on Thursday.

Ben-Amor said Soufiane enjoyed working as a grocer because it kept him in close contact with the community, and he helped many newcomers settle into life in Quebec City. "We saw each other almost every day," Ben-Amor said.

Ben-Amor said Soufiane’s family will fly to Morocco on Saturday to bury him there.