At least 40 people have been killed in a mass shooting at two mosques in Christchurch, New Zealand, prime minister Jacinda Ardern has said.

Police declared a “critical incident” after the initial, deadliest attack began at the Masjid Al Noor mosque in Deans Avenue – where up to 500 people are thought to have been worshipping – and warned residents an “active shooter” was in the area.

A second shooting took place at a mosque on Linwood Avenue. Police urged mosques across the country to close their doors and worshippers to stay away.

We’ll tell you what’s true. You can form your own view.

From 15p €0.18 $0.18 USD 0.27 a day, more exclusives, analysis and extras.

One Australian national and three other people have been taken into custody. Facebook says it is working to take down versions of what appears to be a live stream of the shooting, while a 74-page anti-immigrant manifesto purporting to be penned by the attacker has also been removed online.

New Zealand police wrote on Twitter: “Police [are] responding to a very serious and tragic incident involving an active shooter in central Christchurch. One person is in custody, however police believe there may be other offenders. This is an evolving incident.”

Follow the latest updates live here

Ms Ardern called the attack “one of New Zealand’s darkest days”.

Radio New Zealand (RNZ), the public broadcaster, cited a witness as saying he had seen four people on the ground and “blood everywhere” at the first mosque.

Others witnesses told the New Zealand Herald they had heard more than two dozen gunshots.

Members of the Bangladesh cricket team were reportedly caught up in the Deans Avenue incident but not harmed.

Police Commissioner Mike Bush said in a statement: “Police are responding [at] full capability to manage the situation, but the risk environment remains extremely high.

“Police recommend that residents across Christchurch remain off the streets and indoors until further notice. Christchurch schools will be locked down until further notice.” The schools lockdown was later lifted.

RNZ cited Mustafa Farouk, the head of the Federation of Islamic Associations of New Zealand, as saying between 300 and 500 worshippers were likely inside the mosque at the time of the attack. He said he had been told at least six people were wounded.

“Horrified to hear of Christchurch mosque shootings. There is never a justification for that sort of hatred,” said Amy Adams, a member of parliament from the city.

As well as locking down schools, police have reportedly cleared Cathedral Square, where children were staging a climate change protest.

The deadliest shooting occurred at the 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.

Support free-thinking journalism and subscribe to Independent Minds

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

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.

A man who claimed responsibility for the shooting left a manifesto online in which he said he was a 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”.

Additional reporting by agencies