An Australian far-right extremist charged with murdering 51 Muslim worshippers in last year's mass shooting at two New Zealand mosques unexpectedly flipped his plea to guilty on Thursday. Prime Minister Jacinda Ardern and the Muslim community expressed relief at the surprise decision, which removes the need for a lengthy trial that authorities feared would be used to spout neo-Nazi propaganda. Self-avowed white supremacist Brenton Tarrant, 29, had previously denied 51 charges of murder, 40 of attempted murder and one of terrorism but reversed his plea in a hurriedly arranged court hearing. "Yes, guilty," Tarrant told Christchurch High Court via videolink from Auckland Prison as the charges were read out to him. Tarrant, wearing a grey top, stared intently at the camera while making his confession. Neither the former gym instructor from the Australian country town of Grafton nor his lawyers offered any explanation for the change, which makes him New Zealand's first-ever convicted terrorist. The South Pacific nation does not have the death penalty but Tarrant faces the prospect of spending the rest of his life behind bars. The terror and murder charges all carry life sentences, setting a minimum non-parole period of 17 years but giving the judge power to imprison without the possibility of release. Prime Minister Jacinda Ardern said the admission of guilt would provide some relief to the many people whose lives were shattered in the attack. "These guilty pleas and conviction bring accountability for what happened and also save the families who lost loved ones, those who were injured, and other witnesses, the ordeal of a trial," she said. Asked how she reacted upon hearing the news, Ardern replied: "I let out a huge sigh of relief". Judge Cameron Mander recorded convictions on all charges and said Tarrant would be sentenced at a date yet to be determined. "The guilty pleas represent a very significant step towards bringing finality to this criminal proceeding," he said. The plea came with New Zealand in its first day of a four-week COVID-19 lockdown. Mander said sentencing would take place "at a time when victims and their families can attend the court in person". The judge said advance reporting that Thursday's hearing was taking place was suppressed in case Tarrant changed his mind at the last minute and maintained his innocence. - 'The right direction' - Tarrant's trial had been due to start on June 2 and last some six weeks, with police commissioner Mike Bush saying Thursday's hearing was arranged after the gunman contacted his lawyers on Tuesday. "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," he said in a statement. Bush said imams from the Al Noor and Linwood mosques, the ones targeted by Tarrant, were among only 17 people allowed in court to hear the revised plea. New Zealand's small and tight-knit Muslim community welcomed the fact that they would not have to endure a drawn-out trial raking over painful details of the worst mass shooting in the country's modern history. "I have been praying for him and he has taken the right direction," Farid Ahmed, whose wife Husna was killed, told TVNZ. "I am pleased he is feeling guilty. It is a good start." Tarrant armed himself with an arsenal of semi-automatic weapons and attacked the Al Noor mosque first, before moving on to the Linwood prayer centre, livestreaming the killings as he went. His victims were all Muslim and included children, women and the elderly. In a rambling manifesto posted online before the killing spree, Tarrant said he had moved to New Zealand with the specific aim of conducting an atrocity against Muslims. The document said he became radicalised while travelling around Europe, although intelligence agencies have so far failed to find any evidence he was working with right-wing extremist groups. His actions prompted Ardern, who has vowed never to say the killer's name, to tighten New Zealand's gun laws and launch a campaign to curb online extremism.