• Officials said that one man in his late 20s had been charged with murder, and that two explosive devices were found attached to a vehicle that they had stopped.

• A Muslim leader in New Zealand said the attack was especially shocking as it took place around Friday Prayer. The police urged people to stay away from the mosques until further notice.

• A gunman streamed a live video of the attack on Facebook, and he appeared to have posted a manifesto online.

Two mosques are attacked

Shots were fired at Al Noor Mosque on Deans Avenue in the center of the city and at Linwood Mosque, about three miles away, the police said.

The country’s police commissioner, Mike Bush, said in an evening news conference that 41 people had been killed at Al Noor Mosque and seven at Linwood Mosque, and that another victim had died at Christchurch Hospital.

David Meates, the chief executive of the Canterbury District Health Board, said that 48 people, including young children, were being treated for injuries at the hospital. He said the injuries included gunshot wounds and ranged from critical to minor.

The police said that four people, including three men and one woman, had been taken into custody. Prime Minister Scott Morrison of Australia said that one of them was Australian.

Mr. Bush said that a man in his late 20s had been charged with murder and would appear in Christchurch court on Saturday morning. A number of firearms were recovered from the scenes of the shootings, he said.

Of the three others who were detained, the police commissioner said that one might have had nothing to do with the attack and that the police were working to determine how the other two might have been involved.

Ms. Ardern said earlier that none of those detained were on security watch lists.

Two explosive devices were found on one vehicle, Mr. Bush said, adding that the police had defused one and were in the process of defusing the other.

Mr. Bush had earlier urged people not to go to mosques anywhere in New Zealand on Friday. He also urged mosques nationally to “close your doors until you hear from us again.”

Image

Emergency workers tending to an injured man outside one of the mosques that was attacked in central Christchurch.CreditMark Baker/Associated Press

Video shows part of the shooting

A 17-minute video posted to Facebook shows part of the attack.

The clip, which may have been taken from a helmet camera worn by a gunman, begins behind the wheel of a car. A man, whose face can occasionally be seen in the rearview mirror, drives through the streets of Christchurch before pulling up in front of Al Noor Mosque, beside the sprawling Hagley Park.

He approaches the mosque on foot, his weapon visible, and begins shooting at people at the entrance. What follows is a harrowing nearly two minutes of his firing on worshipers.

At one point the gunman exits the mosque and fires in both directions down the sidewalk before returning to his car for another gun — which, like the others, was inscribed with numbers, symbols or messages. When he re-enters the mosque, he shoots several bodies at close range.

After another few minutes, he returns to his vehicle and drives away.

“There wasn’t even time to aim, there was so many targets,” he says at one point, as the sirens of an emergency response vehicle blare in the background.

A white nationalist manifesto

Before the shooting, someone appearing to be the gunman posted links to a white nationalist manifesto on Twitter and 8chan, an online forum known for extremist right-wing discussions. The 8chan post included a link to what appeared to be the gunman’s Facebook page, where he said he would also broadcast live video of the attack.

The 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 and listed his white nationalist heroes.

Writing that he had purposely used guns to stir discord in the United States over the Second Amendment’s provision on the right to bear arms, he also declared himself a fascist. “For once, the person that will be called a fascist, is an actual fascist,” he wrote.

“I feel absolutely sickened having my name uttered by this person,” Mr. Kjellberg, a Swede, said on Twitter.

Mr. Kjellberg has courted controversy by performing anti-Semitic gestures, which he calls satirical, in his videos. He has a following of 89 million subscribers.

People gathering near one of the mosques that was attacked on Friday.CreditMark Baker/Associated Press

Scrutiny of social media postings

Over the last 18 months, tech companies have promised stronger safeguards to ensure that violent content is not distributed through their sites. But those new safeguards were not enough to stop the posting of a video and manifesto believed related to Friday’s shooting.

A 17-minute video that included graphic footage apparently of the shooting could be found on Facebook, YouTube, Twitter and Instagram more than an hour after being posted. While Facebook and Twitter took down pages thought to be linked to the gunman, the posted content was spread rapidly through other accounts.

In order to evade detection, people appeared to be cropping the video or posting the text of the manifesto as an image — both of which are techniques used to evade automated systems that find and delete content.

Social media companies have heavily invested in those systems, with Facebook reporting last year that more than 99 percent of terrorism content by the Islamic State and Al Qaeda was found and removed through artificial intelligence.

A Facebook spokeswoman offered condolences to the victims and said the company was “removing any praise or support for the crime and the shooter or shooters as soon as we’re aware.”

A resident of Christchurch, New Zealand, spoke to local news reporters on Friday after a deadly attack on two mosques in the city.CreditCreditMark Baker/Associated Press

Waiting to hear from loved ones

Nasreen Hanif, a spokeswoman for the Islamic Women’s Council of New Zealand, said that little news was coming through about whether friends and relatives in Christchurch were safe, and that the country’s Muslims were anxious for updates.

“Nobody’s answering their phones,” she said. “We don’t know if they’re at the hospital or out of reach. Some have posted that they are safe, but others have not.”

She added that because the affected mosques remained cordoned off, with bodies inside, people feared that their relatives or friends were among the dead.

Ms. Hanif said the two mosques in Christchurch had asked for help from the rest of New Zealand’s Muslims to arrange the 49 funerals they would need to plan.

President Recep Tayyip Erdogan of Turkey said that three Turkish citizens were wounded in the attack; the Palestine Liberation Organization’s ambassador to New Zealand said at least one Palestinian was killed; and the group Syrian Solidarity New Zealand said on its Facebook page that “Syrian refugees, including children, have been shot today.”

Australian lawmaker draws condemnation

Senator Fraser Anning, a member of the conservative Katter’s Australian Party, has drawn condemnation at home and abroad for linking the attack to Muslim immigration.

“Does anyone still dispute the link between Muslim immigration and violence?” he tweeted.

Rebukes quickly followed from the highest levels of government in Australia and abroad. “The remarks by Senator Fraser Anning blaming the murderous attacks by a violent, right-wing, extremist terrorist in New Zealand on immigration are disgusting,” Prime Minister Scott Morrison said on Twitter. “Those views have no place in Australia, let alone the Australian Parliament.”

Sajid Javid, the British home secretary, said that Mr. Anning had fanned “the flames of violence & extremism. Australians will be utterly ashamed of this racist man.”

Prime Minister Jacinda Ardern of New Zealand described the shootings at two mosques in Christchurch on Friday as an “extraordinary and unprecedented act of violence.”CreditCreditHagen Hopkins/Getty Images

An ‘unprecedented act of violence’

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

“What has happened here is an extraordinary and unprecedented act of violence,” the prime minister said at a news conference in New Plymouth, describing the shooting as “an act that has absolutely no place in New Zealand.”

“Many of those affected may be migrants to New Zealand — they may even be refugees here,” Ms. Ardern said of the victims. “They are one of us. The person who has perpetrated these acts is not.”

Ibrar Sheikh, the secretary of the Al Mustafa Jamia Masjid in south Auckland, described the two mosques targeted in Christchurch as “a United Nations” of ethnicities.

Queen Elizabeth II of Britain sent her condolences to New Zealand, which is a member of the Commonwealth. “At this tragic time, my thoughts and prayers are with all New Zealanders,” she said in a statement released on Friday.

The White House also conveyed its condolences in a statement from President Trump’s press secretary, Sarah Huckabee Sanders. “The United States strongly condemns the attack in Christchurch,” she said.

Police officers escorting people from a mosque in central Christchurch on Friday.CreditMark Baker/Associated Press

‘My really good friend goes there’

Aman Singh, who works at a convenience store close to the Deans Avenue mosque, said he had heard the gunshots on Friday afternoon, and that shortly afterward people had streamed past the shop, bloody and crying.

Mr. Singh, 26, said he knew several people who worshiped at the mosque.

“My really good friend goes there,” he said, adding that he had not been able to confirm the friend’s whereabouts on Friday afternoon.

Mr. Singh, who moved to New Zealand from India four and a half years ago, was hiding in the store with his wife, waiting for the police to arrive at their location.

He said they would be unlikely to be able to return home soon, as their street was cordoned off because it was close to the Linwood Mosque that was also attacked.

Bloodied bandages on the road after the shooting at Al Noor Mosque.CreditMartin Hunter/SNPA, via Reuters

Murders are rare in New Zealand, but guns aren’t

Murders are rare in New Zealand, and gun homicides even rarer. There were 35 murders countrywide in 2017. And since 2007, gun homicides have been in the single digits each year except 2009, when there were 11.

But there are plenty of guns.

There were 1.2 million registered firearms in the country of 4.6 million people in 2017, according to the Small Arms Survey, a Swiss nonprofit.

New Zealand law allows any person aged 16 or older with an entry-level firearm license to keep any number of common rifles and shotguns, according to GunPolicy.org, a project hosted by the University of Sydney. Most guns can be purchased without being tracked by law enforcement officials.

“New Zealand is almost alone with the United States in not registering 96 percent of its firearms, and those are its most common firearms, the ones most used in crimes,” said Philip Alpers of GunPolicy.org. “There are huge gaps in New Zealand law even if some of its laws are strong.”

It remains unclear what weapons were used in the Christchurch attack, or how and where they were acquired.

A mass shooting in Aramoana, New Zealand, in 1990 — when a man killed 13 people, including two 6-year-olds, after a dispute with his neighbor — led directly to tightened gun laws, including restrictions on “military-style semiautomatic weapons.”

Mr. Alpers said that semiautomatic weapons, for instance, require a special license, and can be bought only one at a time.

He also predicted new restrictions in the aftermath of the terrorist attack. “I can’t think of a country that’s more likely to change its gun laws after something like this,” he said.

The national flag was flown at half-staff on Friday outside the Parliament building in Wellington.CreditMarty Melville/Agence France-Presse — Getty Images