Soon after news broke that six Muslims had been killed in a shooting attack at a mosque in Canada's Quebec City during evening prayers, people of all backgrounds took to social media to express their solidarity.

Gunmen fired on about 50 people inside the Quebec Islamic Cultural Centre on Sunday at 8pm local time (01:00 GMT). At least eight people were also wounded in the incident.

In a series of posts, Twitter users denounced the attack against Muslims and offered condolences to the families of the victims.

Sending my love to the Muslim community in #Quebec , #Canada , and around the world. Violence against Muslims must stop. Solidarity & support. — John Connell (@johnconn9) January 30, 2017

Twitter user Gregory Brown described Sunday as a "sad day for Canada & the victims of this hateful act".

"We must stand against racism and 'other'ing, especially now," he said in a post.

Mag Gardner, another Twitter user, urged her fellow citizens to stand together:

#saintefoy . Canada: together we must stand tall--no matter the background. True North strong and free. — Mag Gardner (@maggardner) January 30, 2017

Justin Trudeau, Canada's prime minister, condemned the shooting as a "terrorist attack on Muslims in a centre of worship and refuge".

"Muslim Canadians are an important part of our national fabric, and these senseless acts have no place in our communities, cities and country," he said in a statement .

READ MORE: Americans raise $600,000 to rebuild burned Texas mosque

While many in the North American country shared words of strength to each other via social media, others expressed concerns about Islamophobia in the country.

Our 4 y.o. at bedtime: "Dad, do we have to be Muslims in secret now?"

"No, love, #ACanadianIsACanadian ." #SainteFoy mosque as she sleeps. — Hakique Virani (@hakique) January 30, 2017

The incident took place a few days after US President Donald Trump barred citizens of seven Muslim-majority countries - Iraq, Syria, Iran, Sudan, Libya, Somalia and Yemen - from entering the United States.

READ MORE: Quebec City mosque attack: Six dead and eight injured

Trump's move led to the detention of incoming refugees at US airports, sparking protests, legal challenges and widespread condemnation from international leaders, rights groups and activists.

And on Twitter, some users said Trump's executive order - referred to by many on social media as "#MuslimBan" - prompted "xenophobia" beyond US borders.

Today's spilt blood is on these two: @POTUS and @VP for further normalizing hatred against Muslims. Hatred transcends borders. #saintefoy — Zen Bandelhi (@ZBandelhi) January 30, 2017

Meanwhile in Canada, shooting in a mosque next to Quebec City. Thank you America 😡 for exporting your fear and xenophobia #SainteFoy — Elba Nino (@elbitacool) January 30, 2017

Twitter users also celebrated the Canadian Muslims in government, posting images and profiles of civil servants.