– A gunman opened fire on two mosques in central Christchurch on Friday, killing multiple people in what the country's prime minister called "an extraordinary and unprecedented act of violence."

The police said one person was in custody, but they were unsure if there were other people involved. The country's police commissioner, Mike Bush, warned residents of central Christchurch to stay indoors and police asked mosques to close.

"This is and will be one of New Zealand's darkest days," New Zealand's prime minister, Jacinda Ardern, said at a news conference.

Bush said a mosque near Hagley Park and a mosque on Linwood Avenue, also in Christchurch, were attacked.

Shortly before the shooting, someone appearing to be the gunman publicly posted links to a manifesto on Twitter and 8chan, an online forum. The 8chan post included a link to what appeared to be the gunman's Facebook page, where he said he would soon broadcast live video of the attack.

The 17-minute video, which appeared to be recorded on a helmet camera, shows his drive to the mosque, followed by a harrowing nearly two minutes of his firing on the worshipers in the mosque before fleeing the building and running back to his car and swapping weapons.

He then re-enters the mosque and again begins shooting, continuing to methodically move through the mosque. Several victims can be seen in the footage, many lying on top of one another motionless in a corner of the room.

After another few minutes, he leaves again, gets in his vehicle and drives away, talking to himself throughout.

"There wasn't even time to aim, there was so many targets," he says at one point.

The video and Twitter posts showed weapons covered in the names of past military generals and men who have recently carried out mass shootings.

In his manifesto, he identified himself as a 28-year-old man born in Australia. He listed his white nationalist heroes, described what he said motivated him to attack, and said he purposely used guns to stir discord in the United States around the Second Amendment.

The website Stuff reported that the police had cleared nearby Cathedral Square, the site of a rally to fight climate change. All Christchurch schools were put on lockdown.

Ardern canceled her events for the rest of the day after the shooting.

The shooting happened a day after the country's minister for climate change, James Shaw, 45, told police that he was grabbed and hit on the street in the country's capital, Wellington.

Reports of the shooting happened as young protesters were gathering in Christchurch and cities around the world to demand action on climate change.

Christchurch, with about 388,000 residents, is the biggest city on New Zealand's South Island, hugging the Pacific Ocean coast.

There hasn't been a mass shooting in New Zealand since 1990, when a man killed 13 people, including two 6-year-olds, after a dispute with his neighbor in the seaside town of Aramoana.

That shooting led to tightened gun laws, including restrictions on military style semi-automatic weapons.