NEW Zealand has been trying to come to terms with the deaths of 49 people killed in shootings at two mosques in Christchurch yesterday.

Most, if not all of them, were gunned down by an immigrant-hating white supremacist who apparently used a helmet-mounted camera to broadcast a live video of the murders on Facebook.

One man was arrested and charged with murder, and two other armed suspects were taken into custody while police tried to determine what role, if any, they played in the attack.

“It is clear that this can now only be described as a terrorist attack,” Prime Minister Jacinda Ardern said, noting that many of the victims could be migrants or refugees. She pronounced it “one of New Zealand’s darkest days”.

READ MORE: The extreme right is a serious danger to us all

The gunman who carried out at least one of the mosque attacks left a jumbled, 74-page manifesto that he posted on social media under the name Brenton Tarrant, identifying himself as a 28-year-old Australian and white supremacist who was out to avenge attacks in Europe perpetrated by Muslims.

He also livestreamed, in graphic detail, 17 minutes of his rampage at Al Noor Mosque, where, armed with at least two assault rifles and a shotgun, he attacked worshippers during prayer, killing at least 41 people.

Several more people were killed in an attack on a second mosque in the city a short time later. At least 48 people were wounded, some critically.

Police did not immediately say whether the same person was responsible for both shootings.

They gave no details about those taken into custody except to say that none had been on any watch list.

READ MORE: Mosque attacker's far-right references to history

In the aftermath, the country’s threat level was raised from low to high, police warned Muslims against going to mosques and the national airline cancelled several flights in and out of Christchurch.

World leaders condemned the violence and offered condolences.

Pakistan’s prime minister Imran Khan and other Islamic leaders pointed to the bloodbath and other such attacks as evidence of rising hostility toward Muslims.

“I blame these increasing terror attacks on the current Islamophobia post-9/11 where Islam & 1.3 bn Muslims have collectively been blamed for any act of terror by a Muslim,” Khan tweeted.

President Donald Trump tweeted: “We stand in solidarity with New Zealand” and pledged to give the country any assistance it needs.

New Zealand, with five million people, has relatively loose gun laws but few gun homicides.

Last year, New Zealand’s prime minister announced that the country would raise its annual refugee quota from 1000 to 1500 in 2020.

READ MORE: Why we should respond to the Christchurch attack with compassion

In the wake of the slaughter, Ardern said that immigrants “have chosen to make New Zealand their home, and it is their home. They are us”.

She said the attack reflected “extremist views that have absolutely no place in New Zealand.”

At the Al Noor mosque, witness Len Peneha said he saw a man dressed in black and wearing a helmet with some kind of device on top enter the house of worship and then heard dozens of shots, followed by people running out in terror.

Peneha, who lives next door, said the gunman ran out of the mosque, dropped what appeared to be a semi-automatic weapon in his driveway and fled.

Peneha then went into the mosque to help the victims.

“I saw dead people everywhere. There were three in the hallway, at the door leading into the mosque, and people inside the mosque,” he said.

“I don’t understand how anyone could do this to these people, to anyone. It’s ridiculous.”

Facebook, Twitter and Google companies scrambled to take down the gunman’s video, which was widely available on social media for hours after the horrific attack.

The footage showed the killer had more assault weapons in the boot of his car, along with what appeared to be explosives.

The second attack took place at the Linwood mosque about three miles away from Al Noor.

Mark Nichols told the New Zealand Herald that he heard about five gunshots and that a worshipper returned fire with a rifle or shotgun.

The gunman said he was not a member of any organisation, acted alone and chose New Zealand to show that even the most remote parts of the world are not free of “mass immigration”.