At least one gunman killed 49 people and wounded more than 20 during Friday prayers at two New Zealand mosques in the country’s worst ever mass shooting, which Prime Minister Jacinda Ardern condemned as terrorism, Reuters reported.

A gunman broadcast live 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 four people taken into custody held extremist views but had not been on any police watchlists.

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

Police said later three people were in custody and one man in his late 20s had been charged with murder. He will appear in court on Saturday.

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.

Police Commissioner Mike Bush said 49 people had been killed in total.

The 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.

Worshippers, possibly dead or wounded, lay huddled on the floor, the video showed. Reuters was unable to confirm the authenticity of the footage.

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.

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.

The Facebook link directed users to the page of a user called brenton.tarrant.9.

A Twitter account with the handle @brentontarrant posted on Wednesday images of a rifle and other military gear decorated with names and messages connected to white nationalism. What looked like the same weapons appeared in the livestream of the mosque attack on Friday.

***

Gunmen entered two mosques and began shooting in New Zealand's city of Christchurch on Friday killing at least 40 people - an unprecedented attack in the quiet country in the Pacific, Al Jazeera reported.

New Zealand's Prime Minister Jacinda Ardern told a news conference that 20 others were in serious condition after the "terrorist" attack.

Police Commissioner Mike Bush said four suspects were in custody - three men and a woman.

Sam Clarke, a reporter with TVNZ, spoke with several people inside the Masjid Al Noor mosque when the shooting began. He told Al Jazeera a man entered with an automatic weapon and began firing.

"A gunman - dressed in black with a helmet carrying a machine gun - came into the back of the mosque and started firing into the people praying there," said Clarke.

Police confirmed a second shooting occurred at the Linwood mosque during Friday prayers in the South Island city, but no details were immediately available.

Ardern said: "This is, and will be, one of New Zealand's darkest days."

Authorities have not described the scale of Friday's shootings but urged people in central Christchurch to stay indoors. New Zealand media reported between nine and 27 people were killed, but the death toll could not be confirmed.

Police warned worshippers not to visit mosques "anywhere in New Zealand". A lockdown imposed throughout Christchurch was called off at about 05:00 GMT.

Australian Prime Minister Scott Morrison said one of the suspects was an Australian national, calling him an "extremist, right-wing, violent terrorist".

***

A gunman opened fire on Friday prayers at a mosque in New Zealand killing many worshippers and forcing the city of Christchurch into lockdown, in what looked set to be the country’s worst ever mass shooting, Reuters reported.

New Zealand media reported that between nine and 27 people were killed, but the death toll could not be confirmed. Police said multiple fatalities had occurred at two mosques, but it was unclear how many attackers were involved.

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.

Worshippers, possibly dead or wounded, lay huddled on the floor of the mosque, the video showed. Reuters was unable to confirm the authenticity of the footage.

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.

Radio New Zealand quoted a witness inside the mosque saying he heard shots fired and at least four people were lying on the ground and “there was blood everywhere”.

Prime Minister Jacinda Ardern condemned what she called “an extraordinary and unprecedented act of violence”.

“This is one of New Zealand’s darkest days,” she said.

Neither Ardern nor police gave a casualty toll.

New Zealand’s Police Commissioner Mike Bush said four people - three men and a woman - had been taken into custody but it was not clear if the gunman was among them or if other people were involved.

Bush also said it should not be assumed the attack was isolated to Christchurch. “At this point in time we should never make assumptions,” he said.

Bush also said IEDs, improvised explosive devices, were found with a vehicle they stopped.

The online video footage, which appeared to have been captured on a camera strapped to the gunman’s head, showed red petrol canisters in the back of his car, along with weapons.

All mosques in New Zealand had been asked to shut their doors, police said.

The Bangladesh cricket team was arriving for Friday prayers when the shooting occurred but all members were safe, a team coach told Reuters.

The foreign minister of Indonesia, which has the world’s biggest Muslim population, condemned the shooting.

Muslims account for just over 1 percent of New Zealand’s population, a 2013 census showed.

“Many of those who would have been affected by this shooting may be migrants to New Zealand,” Ardern said.

“They may even be refugees here. They have chosen to make New Zealand their home and it is their home ... they are us. The persons who has perpetuated this violence against us ... have no place in New Zealand.”