Mourners react as they pay their respects at a makeshift memorial outside Christchurch hospital in Christchurch, New Zealand, Saturday, March 16, 2019, a day after the mass shooting at two mosques. Credit: Vincent Thian | AP

CHRISTCHURCH, New Zealand — Manacled and barefoot, Brenton Harrison Tarrant walked into a courtroom on Saturday and flashed an “OK” sign, widely seen as a symbol of white power, as he stood defiantly to face murder charges less than 24 hours after brutal assaults on two mosques in this city left at least 49 dead.

Police named Tarrant the primary suspect in what was called the deadliest attack in New Zealand history — and one of the worst cases of right-wing terrorism in years — after the 28 year-old Australian allegedly stormed two mosques during midday prayers on Friday and mowed down dozens of huddling and fleeing worshippers while he streamed the mass killing over social media with a body-mounted camera.

Two others have been arrested in connection with the shootings: A second man, 18-year old Daniel John Burrough, is expected to appear in court soon and face charges of inciting racial hostility or ill will. A third accomplice remains unidentified.

Christchurch hospital officials said midday Saturday that 39 people, including 2 children, remained hospitalized, with 11 in critical condition. Authorities said Tarrant was the prime suspect, and there were no immediate signs that he was part of a broader plot. Still, scores of additional police were deployed as New Zealand raised its national security threat level to “high” for the first time in its history.

The murderous rampage sundered life in New Zealand, an island country of 5 million celebrated for its low crime rate, and sent shock waves around the world at a time when many countries are grappling with the rise in right-wing extremism.

During his hearing, which was closed to the public by Judge Paul Kellar in the interest of safety — an unusual move for New Zealand courts — Tarrant did not enter a plea to the murder charge. He appeared in white prison garb and stayed silent throughout.

Photos from the courtroom showed Tarrant standing in the dock, flanked by two police officers, as he shaped his right thumb and forefinger in a gesture that is widely seen as signifying white power. He will remain in custody and appear at another hearing on April 5, when he is expected to face additional charges. The judge ordered that photographs of Tarrant’s face be pixelated, to protect the integrity of the trial process.

Prime Minister Jacinda Ardern, who decried the attack as an act of terrorism that plunged New Zealand into one of its “darkest days,” said Saturday that the country’s security services were tracking the “global rise in extreme right-wing rhetoric” but had not put Tarrant on a watch list. Security officials are now investigating whether they had overlooked signs of an imminent attack, Ardern said.

The New Zealand Herald reported Saturday that Tarrant had sent a copy of a lengthy manifesto explaining his actions to Ardern’s office and many media outlets minutes before the attack began.

None of the three arrested suspects had criminal records, and Tarrant had a registered address in southern New Zealand but lived in the country sporadically. Instead, the former fitness trainer led an itinerant lifestyle and traveled extensively to Bulgaria, North Korea and countries with large Muslim populations, including Turkey and Pakistan, officials said.

Yet in a 74-page manifesto posted on social media before the shooting, Tarrant explicitly vowed an attack to kill Muslim “invaders” and seek revenge for crimes perpetrated by Muslims. In the document, which was laced with inside jokes and references to fringe online subculture, Tarrant said hoped his actions would curb immigration, deepen strife in the United States over gun ownership and start a civil war.

He also expressed his admiration for Dylann Roof and Anders Breivik, two far-right mass killers, and scrawled neo-Nazi symbols and slogans on his weapons, which included two rifles and two shotguns.

Ardern, who has vowed to change New Zealand’s gun laws following the shooting, said her government was looking into how Tarrant had modified his rifles to make them more deadly. She didn’t give details about gun legislation she was considering, but New Zealand Attorney General David Parker reportedly said at an Auckland rally on Saturday the government would ban semiautomatic rifles.

Tarrant obtained a license in November 2017 for the guns that would be used in the shooting; he began purchasing the weapons that December, according to officials.

A day after the massacre, Christchurch woke up to confront an incomprehensible aftermath. Friends and families of the dead pleaded with police to allow access to bodies so they could perform Islamic death rituals. The more fortunate rushed to the Christchurch Hospital to visit survivors, some of whom were bullet-riddled.

Many laid flowers at large vigils. Others volunteered at a Salvation Army station outside the mosque to offer what they could: soup, pies, words of comfort.

Outside the Christchurch courtroom on Saturday, Omar and Yama Nabi spoke about their lost 71-year old father Hajji Daoud Nabi, a refugee of the Soviet-Afghan War who arrived in New Zealand decades ago.

Survivors told Omar Nabi that his father had leaped on top of another worshipper as a human shield when the attack unfolded at Al Noor mosque. Nabi had come to the court to get a glimpse of the man who killed his father, he said, but the public was not allowed inside.

“I need to sit there and watch what’s going on,” Nabi said. “One part of me wants to kill him, but this is not what I want to portray Muslims as.”

Yama Nabi narrowly averted danger after arriving late to Friday prayers. By the time he arrived, he said, he saw a Somali man cradling his dead son and bodies strewn in the mosque’s hallway, a grisly scene visible from the street.

As the overcast sky gave way to gently pattering rain, Rami, 28, stood outside the Christchurch hospital and recalled his desperation on Friday as he spoke on the phone with his father, who was shot and bleeding inside the mosque. Police would not let Rami or paramedics into the mosque immediately after the shooting as they tried to ensure the area was secured.

“It was a horrific incident and horrific to be on the phone to my Dad,” Rami said as he waited outside the hospital for his father to recover from nerve reconstruction surgery.

“He was shot in the thigh and the buttocks, it hit his hip. . . . He’s in a lot of pain,” he said.

The killings touched a nerve around the world. President Donald Trump, in a statement issued Friday morning, extended his “warmest sympathy and best wishes” to the people of New Zealand. Hours later, Trump downplayed the danger of rising white nationalist extremism. “I think it’s a small group of people that have very, very serious problems,” he said.

The massacre, seemingly designed and carried out as performance for an online audience, has renewed scrutiny of the unfiltered power of the large social media hubs, including Facebook and Twitter, but also of the dark and freewheeling online forums like 8chan, where hate speech mingles with memes and wisecracks.

Social media companies, including Facebook, Twitter and Reddit on Friday removed the shooter’s video, but it was immediately reposted elsewhere. As a result, the shooter got precisely what he wanted: the attention of millions who watched a chilling, first-person record of the gunman walking up to the Al Noor Mosque and firing hundreds of bullets, slaughtering dozens without saying a word. In a six-minute video segment, he walks back to his car to get another weapon before doubling back to kill the wounded.

Authorities in Australia said Tarrant’s relatives in the sleepy town of Grafton had come forward to assist with their investigation into his past and path to radicalization. In his own manifesto laying out his thinking and influences, Tarrant said he developed racist views and began planning his operation in 2017 after a trip to Europe.

Tarrant titled his 16,000-screed “The Great Replacement,” echoing the name of a book by a far-right French polemicist Renaud Camus. The phrase has also been the rallying cry of, among others, the torch-bearing protesters who marched in Charlottesville in 2017.

At one point in the rambling document, which was littered with conspiracy theories about white birthrates and “white genocide,” Tarrant called Trump a “symbol of white identity” but in the same sentence derided the president’s ability as a political leader.

In a country of nearly 5 million, more than 46,000 residents of New Zealand are Muslim, according to data from the 2013 Census, up 28 percent from 2006. Many of the shooting victims were refugees or migrants from Pakistan, India, Malaysia, Indonesia, Turkey, Somalia and Afghanistan.

Members of a refugee family who had fled Syria’s civil war appeared to be among the victims, Ali Akil, an Auckland-based spokesman for Syrian Solidarity New Zealand, said in an interview. The family’s father was killed, a son was seriously wounded, and another son was reported missing, Akil said, citing information he had received from a friend of the family.

Akil said the family had likely come to New Zealand in the past four or five years, to “a safe haven, only to be killed here.”

Ardern, the prime minister, said New Zealand was chosen for the attack “because we represent diversity, kindness, compassion, a home for those who share our values.”

“This is not the New Zealand any of us know,” she said.

Washington Post writers Isaac Stanley-Becker, Eli Rosenberg and Alex Horton contributed to this report.