Six people have been killed and eight wounded after gunmen opened fire in a Quebec City mosque in what Canadian Prime Minister Justin Trudeau calls "a terrorist attack on Muslims."

Police said two suspects had been arrested, but gave no more details into what prompted the attack, saying the investigation had just begun.

Initially, the mosque president said five people were killed in the shooting, and a witness said up to three gunmen had fired on about 40 people inside the Quebec City Islamic Cultural Centre. Police said only two people were involved in the attack.

Martin St. Louis holds a sign that reads 'la paix pas la guerre' (peace, not war) near a Quebec city mosque after a deadly shooting. Photo / AP
Martin St. Louis holds a sign that reads 'la paix pas la guerre' (peace, not war) near a Quebec city mosque after a deadly shooting. Photo / AP

"We condemn this terrorist attack on Muslims in a centre of worship and refuge," Trudeau said in a statement.

Advertisement

A witness said a heavily armed police tactical squad was seen entering the three-storey mosque. Police declined to say whether there was a gunman inside the mosque at the time.

Quebec police on the scene said there had been fatalities and that two people had been arrested.

"There are many victims ... there are deaths," a Quebec police spokesman told reporters.

A witness said a heavily armed police tactical squad was seen entering the mosque.

Police spokesman Etienne Doyon declined to say whether there was still a gunman inside the mosque.

Police later tweeted: "The situation is under control."Yangui, who was not inside the mosque when the shooting occurred, said he got frantic calls from people at evening prayers.

He did not know how many were injured, saying they had been taken to different hospitals across Quebec City.

The shooting comes after Canada said it would offer temporary residency permits to travellers stranded in the country by US President Donald Trump's order banning travellers from seven Muslim-majority nations, the immigration minister says.

Police survey the scene. Photo / AP
Police survey the scene. Photo / AP

Mosque president Mohamed Yangui, who was not inside when the shooting occurred, said he got frantic calls from people at Sunday evening prayers.

He did not know how many were injured, saying they had been taken to different hospitals across Quebec City.

"Why is this happening here? This is barbaric," Yangui told reporters.

The shooting came on the weekend that Trudeau said Canada would welcome refugees after President Donald Trump suspended the US refugee program and temporarily barred citizens from seven Muslim-majority nations from entering the United States on national security grounds.

Like France, Quebec has struggled at times to reconcile its secular identity with a rising Muslim population, many of them North African emigrants. In June 2016, a pig's head was left on the doorstep of the cultural centre. Incidents of Islamophobia have increased in Quebec in recent years.

The face- covering, or niqab, became a big issue in the 2015 Canadian federal election, especially in Quebec, where the vast majority of the population supported a ban on it at citizenship ceremonies.

- AAP