CHRISTCHURCH, New Zealand — Surprise, relief and a "mix of emotions" greeted the news Thursday that Brenton Tarrant, the man who had carried out New Zealand's worst peacetime atrocity, had reversed his not-guilty plea and was convicted on all charges.

Tarrant killed 51 worshipers and injured dozens at two mosques in Christchurch on March 15 last year. The first of the attacks was live-streamed on the Internet.

The Australian national was charged with the highest number of murder counts brought against an individual in New Zealand’s history, to which a terrorism offense and 40 counts of attempted murder were added.

The reasons behind Tarrant’s surprise move to switch his plea to guilty remain unclear; he had previously denied culpability, and a trial had been scheduled for June. The news broke as New Zealand began a nationwide lockdown to curb the spread of the novel coronavirus.

Appearing in Christchurch High Court on Thursday by video link from an Auckland prison, a gaunt Tarrant, 29, listened to the court registrar read out the charges and the names of the dead. Two senior members of Christchurch’s Muslim community were present, although victims’ families and other survivors did not attend.

Tarrant, who could face life in prison, was remanded into custody by Justice Cameron Mander, the presiding judge, until May 1, by which time a date for the sentencing would be set. Attorneys for Tarrant, New Zealand’s first convicted terrorist, did not respond to a request for comment.

The mosque attacks prompted New Zealand’s government to ban assault weapons, implement a buyback of existing firearms and ramp up surveillance. The massacre also fueled questions about whether intelligence and security agencies had been sufficiently rigorous in monitoring far-right or white-supremacist networks.

Jamal Green, spokesman for Al Noor Mosque, which was targeted in the attacks, said he did not know in advance about Tarrant’s decision to plead guilty. The reaction from the community was “one of relief and great surprise; tears of joy, even,” Green said.

“It should be acknowledged, however, that there will be a mix of emotions,” he added. “This is no easy joy or satisfaction. Every community that has been a victim of hate and loss will recognize a kind of emptiness when their world has suffered in this way.”

Graeme Edgeler, a Wellington-based lawyer and legal commentator, noted that a guilty plea, however belated, might open the possibility of a sentence with parole.

“In New Zealand, a person pleading guilty is usually entitled to a reduction in their sentence for the guilty plea, so there may be a hope that a guilty plea will mean there will only be a life sentence with a very long nonparole period, instead of a sentence of life without parole,” he said.

The offense is so serious, however, “that even with a guilty plea, a life-without-parole sentence must still be likely,” Edgeler added.

Police said arrangements for Thursday’s hearing were made hastily after Tarrant indicated through his attorney on Tuesday that he wished to be brought before the court. “Police appreciate this news will come as a surprise to the victims and the public, some of whom may have wished to be present in the courtroom,” they said in a statement.

Omar Nabi, whose father, Haji Daoud Nabi, died in the attacks, said he felt relief on hearing the news but added that “to be there, to see it unfold would have been a lot better” than finding out through the media. Still, he understood that this would not have been possible because of the lockdown in place amid the coronavirus pandemic. He said he plans to attend the sentencing.

Anjum Rahman, a spokeswoman for New Zealand’s Islamic Women’s Council, said that while the guilty plea did not deliver closure, “the main thing is that we do not have to sit through a whole court case and hear a defense of atrocious acts.”

New Zealand has been conducting an official inquiry into the massacre, with agencies such as the intelligence services questioned about the circumstances leading to the atrocity. But much evidence had been subject to suppression orders to avoid jeopardizing Tarrant’s right to a fair trial.

With Tarrant’s guilty plea, Rahman called Thursday for the inquiry evidence to be made public.

“Now that there isn’t a [trial], there isn’t a reason to suppress any evidence,” she said.

Prime Minister Jacinda Ardern said the guilty plea would “provide some relief to the many people whose lives were shattered by what happened on March 15.”