(Reuters) - A deadly mass shooting at two mosques in New Zealand during Friday prayers has horrified residents of the South Pacific nation known for its low levels of gun violence and a reputation for tolerance and safety.

Forty nine people were killed and more than 20 seriously wounded in the attacks in Christchurch, New Zealand Police Commissioner Mike Bush said.

Video footage widely circulated on social media, apparently taken by a gunman and posted online live as the attack unfolded, showed him driving to one mosque, entering it and shooting randomly at people inside.

“It is clear that this can now only be described as a terrorist attack,” Prime Minister Jacinda Ardern said, adding it marked one of New Zealand’s darkest days.

“Many of those who would have been affected by this shooting may be migrants to New Zealand. They may even be refugees here. They have chosen to make New Zealand their home and it is their home,” she said.

Online discussion site 8chan, known for a wide range of content including hate speech, carried an anonymous post that linked to the gunman’s online live footage of the attack on one of the two mosques and a “manifesto” denouncing immigration.

The manifesto said New Zealand was not originally chosen for the attack, but was identified as a “target rich of an environment as anywhere else in the West”.

An attack in New Zealand would show “that nowhere in the world was safe, the invaders were in all of our lands, even in the remotest areas of the world and that there was nowhere left to go that was safe and free from mass immigration,” the manifesto read.

Reuters was unable to confirm the authenticity of the manifesto.

Slideshow ( 4 images )

Paul Buchanan, a former intelligence and defense policy analyst now with consultancy 36th Parallel Assessments, said the threat from neo-Nazi groups in New Zealand was well-known.

“Christchurch has a very active white supremacist community, a community that has attacked refugees and people of color on multiple occasions over the last 20 years,” he told Radio New Zealand.

“It shows we don’t live in a benign environment in this day and age, we’ve been infected with the virus of extremism. The thing is it came from white supremacists, not from the Islamic community that was the target today.”

Muslims account for just over 1 percent of New Zealand’s population, a 2013 census showed, with more than three-quarters born overseas.

A 2011 study by Victoria University of Wellington found migrants from some Muslim majority countries were viewed less favorably than migrants from Britain and elsewhere.

Media discourse suggested many New Zealanders may be uncertain about, if not unreceptive to, Muslim immigrants, the study said.

In the wake of the attack, there was an outpouring of sympathy and disbelief.

“I’m just heartbroken. In fact I’m sitting here crying,” Muslim Association of Marlborough chairman Zayd Blissett told the Stuff website. “This is New Zealand. This can’t happen here.”

Slideshow ( 4 images )

New Zealand has experienced several mass shootings in recent decades, including when a lone gunman killed 13 people in the small South Island town of Aramoana in 1990 following a dispute with neighbors.

The gunman was shot and killed by police, and gun licensing laws were strengthened to include tight restrictions on military style semi-automatic firearms.

According to gun control advocacy group GunPolicy.org, hosted by the University of Sydney, New Zealand’s population of almost 5 million has around 1.2 million guns in private hands.

In the decade to 2013, the most recent figures, gun homicides in the country ranged from three to 12 deaths per year.

Ardern said New Zealand was a not a target because it was a safe harbor for those who hate, condoned racism, or because it was an enclave for extremism.

“We were chosen for the very fact we are none of these things, because we represent diversity, kindness, compassion, a home for those who share our values, refuge for those who need it,” she told reporters. “And those values, I assure, will not and cannot be shaken by this attack.”