Six people were killed and eight wounded when gunmen opened fire at a Quebec City mosque during Sunday night prayers, in what Canadian Prime Minister Justin Trudeau called a "terrorist attack on Muslims".

Prime Minister Justin Trudeau said in a statement: “We condemn this terrorist attack on Muslims in a centre of worship and refuge”. (Reuters)

Six people were killed and eight wounded when gunmen opened fire at a Quebec City mosque during Sunday night prayers, in what Canadian Prime Minister Justin Trudeau called a “terrorist attack on Muslims”.

Police said two suspects had been arrested, but gave no details about them or what prompted the attack.

Initially, the mosque president said five people were killed 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.

“Six people are confirmed dead – they range in age from 35 to about 70,” Quebec provincial police spokeswoman Christine Coulombe told reporters, adding eight people were wounded and 39 were unharmed.

The mosque’s president, Mohamed Yangui, who was not inside when the shooting occurred, said he got frantic calls from people at evening prayers.

“Why is this happening here? This is barbaric,” he said.

Prime Minister Justin Trudeau said in a statement: “We condemn this 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.”

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

A Canadian federal Liberal legislator, Greg Fergus, tweeted: “This is an act of terrorism — the result of years of sermonizing Muslims. Words matter and hateful speeches have consequences!”

The premier of Quebec province, Philippe Couillard, said security would be increased at mosques in Quebec City and Montreal.

“We are with you. You are home,” Couillard said, directing his comments at the province’s Muslim community. “You are welcome in your home. We are all Quebecers. We must continue together to build an open welcoming and peaceful society”.

New York Mayor Bill de Blasio said police were providing additional protection for mosques in that city following the Quebec shooting. “All New Yorkers should be vigilant. If you see something, say something,” he tweeted.

‘NOT SAFE HERE’

French President Francois Hollande condemned the attack.

“The terrorists wanted to attack the spirit of peace and tolerance of the citizens of Quebec,” Hollande said in a statement on Monday. “France stands shoulder to shoulder with the victims and their families”.

Like France, Quebec has struggled at times to reconcile its secular identity with a rising Muslim population, many of them from North Africa.

In June last year, a pig’s head was left on the doorstep of the cultural centre.

“We are not safe here,” said Mohammed Oudghiri, who normally attends prayers at the mosque in the middle-class, residential area, but did not on Sunday.

Oudghiri said he had lived in Quebec for 42 years but was now “very worried” and thinking of moving back to Morocco.

Mass shootings are rare in Canada, which has stricter gun laws than the United States, and news of the shooting sent a shockwave through mosques and community centres throughout the mostly French-language province.

“It’s a sad day for all Quebecers and Canadians to see a terrorist attack happen in peaceful Quebec City,” said Mohamed Yacoub, co-chairman of an Islamic community centre in a Montreal suburb.

“I hope it’s an isolated incident.”

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 majority of the population supported a ban on it at citizenship ceremonies.

In 2013, police investigated after a mosque in the Saguenay region of the province was splattered with what was believed to be pig blood. In the neighbouring province of Ontario, a mosque was set on fire in 2015, a day after an attack by gunmen and suicide bombers in Paris.

Zebida Bendjeddou, who left the Quebec City mosque earlier on Sunday evening, said the centre had received threats.

“In June, they’d put a pig’s head in front of the mosque. But we thought: ‘Oh, they’re isolated events.’ We didn’t take it seriously. But tonight, those isolated events, they take on a different scope,” she said.

Bendjeddou said she had not confirmed the names of those killed, but added: “They’re people we know, for sure. People we knew since they were little kids.”