At least one gunman killed 49 people and wounded more than 40 during Friday prayers at two New Zealand mosques in the country's worst ever mass shooting, which Prime Minister Jacinda Ardern condemned as terrorism.
A gunman broadcast livestream footage on Facebook of the attack on one mosque in the city of Christchurch, mirroring the carnage played out in video games, after publishing a "manifesto" in which he denounced immigrants, calling them "invaders."
New Zealand was placed on its highest security threat level, Ardern said, adding that "this can now only be described as a terrorist attack."
Police said three people were in custody including one man in his late 20s who had been charged with murder.
He will appear in court on Saturday.
"We were not chosen for this act of violence because we condone racism, because we are enclave for extremism," Ardern said in a national address. "We were chosen for the fact that we are none of these things. It was because we represent diversity, kindness, compassion, a home for those who share our values.
"You have chosen us but we utterly reject and condemn you."
Police Commissioner Mike Bush said 49 people had been killed in total. Health authorities said 48 people were being treated for gunshot wounds, including young children.
One man who said he was at the Al Noor mosque told media the gunman was white, blond and wearing a helmet and a bulletproof vest. The man burst into the mosque as worshippers were kneeling for prayers.
"He had a big gun ... he came and started shooting everyone in the mosque, everywhere," said the man, Ahmad Al-Mahmoud. He said he and others escaped by breaking through a glass door.
Forty-one people were killed at the Al Noor mosque, seven at a mosque in the Linwood neighborhood and one died in hospital, police said. Hospitals said children were among the victims.
The visiting Bangladesh cricket team was arriving for prayers at one of the mosques when the shooting started but all members were safe, a team coach told Reuters.
Three Bangladeshis were among the dead and one was missing, the consulate said.
Shortly before the attack began, an anonymous post on the discussion site 8chan, known for a wide range of content including hate speech, said the writer was going to “carry out an attack against the invaders” and included links to a Facebook live stream, in which the shooting appeared, and a manifesto.
The manifesto cited "white genocide," a term typically used by racist groups to refer to immigration and the growth of minority populations, as his motivation.
Facebook and Twitter said they would take down content involving the shootings.
It was not immediately clear if the attacks at the two mosques were carried out by the same man.
Australian Prime Minister Scott Morrison said one of the men in custody was Australian.
All mosques in New Zealand had been asked to shut their doors and armed guards posted at them, police said, adding they were not actively looking for any other "identified suspects."
Political and Islamic leaders across Asia and the Middle East condemned the killings.
"I blame these increasing terror attacks on the current Islamophobia post-9/11," Pakistan Prime Minister Imran Khan posted on social media. "1.3 billion Muslims have collectively been blamed for any act of terror."
Al-Azhar University, Egypt's 1000-year-old seat of Sunni Islamic learning, said the attacks had "violated the sanctity of the houses of God."
"We warn the attack is a dangerous indicator of the dire consequences of escalating hate speech, xenophobia, and the spread of Islamophobia."
Six Indonesians had been inside one of the mosques, with three managing to escape and three unaccounted for, its foreign minister said.
Afghanistan's ambassador said on Twitter three Afghans had been wounded. Two Malaysians were wounded, their foreign ministry said.
Muslims account for just over 1 percent of New Zealand's population, a 2013 census showed.
Violent crime is rare in New Zealand and police do not usually carry guns. Britain's Queen Elizabeth, the head of state of New Zealand, said she was deeply saddened by the shootings.
Before Friday, New Zealand's worst mass shooting was in 1990 when a gun-mad loner killed 13 men, women and children in a 24-hour rampage in the tiny seaside village of Aramoana. He was killed by police.