Forty-nine people have been killed and more than 20 seriously injured in mass shootings at two mosques in New Zealand.

Prime Minister Jacinda Ardern described it as “one of New Zealand’s darkest days” and said the events in the city of Christchurch represented “an extraordinary and unprecedented act of violence”.

Three men and one woman were taken into custody, Police Commissioner Mike Bush said.

He said police had defused a number of improvised explosive devices found on vehicles after the shootings.

A man who claimed responsibility for the shootings left a 74-page anti-immigrant manifesto in which he explained who he was and his reasoning for his actions.

He said he considered it a terrorist attack.

New Zealand Mosque ShootingAmbulance staff with a man outside a mosque in central Christchurch (Mark Baker/AP)

Ms Ardern at her news conference alluded to anti-immigrant sentiment as the possible motive, saying that while many people affected by the shootings may be migrants or refugees “they have chosen to make New Zealand their home, and it is their home. They are us. The person who has perpetuated this violence against us is not”.

Authorities have not yet said how many people were killed and wounded.

“It’s a very serious and grave situation,” Mr Bush said.

Anybody who was thinking of going to a mosque anywhere in New Zealand on Friday should stay put, he added.

The deadliest shooting occurred at the Masjid Al Noor mosque in central Christchurch at about 1.45pm local time.

Witness Len Peneha said he saw a man dressed in black enter the mosque and then heard dozens of shots, followed by people running from the mosque in terror.

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

Mr Peneha said he then went into the mosque to try to help.

“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.”

New Zealand Mosque ShootingArmed police patrol outside a mosque in central Christchurch (Mark Baker/AP)

He said he helped about five people recover in his home. He said one was slightly injured.

“I’ve lived next door to this mosque for about five years and the people are great, they’re very friendly,” he said. “I just don’t understand it.”

He said the gunman was white and was wearing a helmet with some kind of device on top, giving him a military-type appearance.

Police said there was a second shooting at the Linwood Masjid Mosque.

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

Mr Nichols said he saw two injured people being carried out on stretchers past his automotive shop and that both people appeared to be alive.

The man who claimed responsibility for the shooting said he was 28-year-old white Australian who came to New Zealand only to plan and train for the attack.

He said he was not a member of any organisation, but had donated to and interacted with many nationalist groups, though he acted alone and no group ordered the attack.

He said the mosques in Christchurch and Linwood would be the targets, as would a third mosque in the town of Ashburton if he could make it there.

He said he chose New Zealand because of its location, to show that even the most remote parts of the world were not free of “mass immigration”.