A white supremacist who killed 51 people at two mosques in New Zealand will serve life in jail without parole - the first person in the country's history to receive the sentence.
Australian Brenton Tarrant, 29, admitted to the murder of 51 people, attempted murder of another 40 people and one charge of terrorism.
The judge called Tarrant's actions "inhuman", saying he "showed no mercy".
The attack last March, which was livestreamed, shocked the world.
Tarrant's sentencing also marks the first terrorism conviction in New Zealand's history.
"Your crimes are so wicked that even if you are detained until you die, it will not exhaust the requirements of punishment," said Judge Cameron Mander in a Christchurch court on Thursday.
On imposing a sentence of life without parole, Justice Mander said: "If not here, then when?"
A sentence without parole means the offender will not be given the opportunity to leave prison after serving only a portion of their total sentence.
Justice Mander said such life sentences without parole were reserved only for the "very worst murders".
New Zealand does not have the death penalty as part of its justice system.
New Zealand Prime Minister Jacinda Ardern, upon hearing of Tarrant's sentencing, said it meant he would have "no notoriety, no platform... and we have no cause to think about him, to see him or to hear from him again".
"Today I hope is the last where we have any cause to hear or utter the name of the terrorist," she said.
The shootings prompted New Zealand to pass stricter gun laws and buy back certain types of weapons from owners.
What did the judge say?
On the last day of a four-day sentencing hearing, Justice Mander spent almost an hour reminding Tarrant of each person he killed and injured.
He added that despite the gunman's guilty pleas, the gunman appeared "neither contrite nor ashamed".
Tarrant, who said through a lawyer in court that he did not oppose the prosecution's application for a life without parole sentence, did not react to the sentence. He had earlier also refused the right to speak at his sentencing.
The sentencing hearing began on Monday, with a large part of the first three days dedicated to hearing victim impact statements.
Tarrant appeared largely emotionless over the past three days, as almost 90 victims - some grieving, others defiant - confronted him.
Sara Qasem, whose father Abdelfattah Qasem died at the Al Noor Mosque, spoke of the last moments of his death, saying: "I wonder if he was in pain, if he was frightened, and what his final thoughts were. And I wish more than anything in the world that I could have been there to hold his hand and tell him it would all be OK."
She struggled to hold back her tears, before looking at Tarrant and saying "these tears are not for you".
How did survivors and relatives react?
Ahmed Wali Khan, who lost his uncle in the attacks, told the BBC that the Muslim community in Christchurch welcomed the verdict.
"Everyone was quite happy that justice has been served," he said, adding that the community had been "waiting for this decision for a very long time".
Taj Kamran, an Afghan refugee who was shot several times in the leg and still requires walking aids, said he would "be able to sleep" after the verdict, though it would not return those who were lost.
"No punishment is going to bring our loved ones back and our sadness will continue for the rest of our lives," he told the AFP news agency.
Irfan Yunianto, a doctoral student from Indonesia who survived the shootings, said he was relieved that the gunman had finally been sentenced.
"I was at the shooting location. Many of my friends died. I also saw with my own eyes how my friends were trying to save the victims," he said.
"I accept the court decision with good grace," he added. "Following this trial has been really hard, but I still watched it online. After the verdict was reached I felt so relieved because the court finally delivered its final verdict."
Tarrant received the maximum possible sentence in New Zealand, which does not have the death penalty.
"We are not in a country where we can expect the death penalty. But they have served justice, giving the maximum prison time without parole," said Hina Amir, 34, who was outside Al Noor mosque when Tarrant began his attack.
What happened in Christchurch?
The gunman opened fire on two mosques in the city on 15 March last year.
He first targeted worshippers inside the Al Noor mosque. Less than 30 seconds later, he returned to his car to pick up another weapon and then re-entered the mosque and resumed firing on those inside.
The entire incident was broadcast on Facebook Live via a headcam he was wearing.
He then drove to the Linwood Islamic Centre where he shot two people outside and then shot at the windows.
A man from inside rushed outside and picked up one of the attacker's shotguns before chasing him away.
Two police officers then chased and arrested the gunman. After his arrest, he told police that his plan was to burn down mosques after his attack and he wished he had done so.
During this week's sentencing, the court heard that the gunman planned to target another mosque but was detained by officers on the way.
What do we know about Tarrant?
The 29-year-old white supremacist has been described by Australian Prime Minister Scott Morrison as an "extremist, right-wing terrorist".
He was born in the Australian state of New South Wales to a father who was a garbage collector and a mother who was a teacher.
After the death of his father in 2010, he quit his job and travelled through parts of Asia and Europe.
His grandmother told news outlet 9News that she believed these travels changed him, saying: "It's only since he travelled overseas I think that boy has changed - completely to the boy we knew".
He moved to New Zealand in 2017 and started planning his attacks against the Muslim community.
He was active on fringe online forums and posted a 74-page "manifesto" online prior to his attack.
How did New Zealand respond?
The attack prompted New Zealand to reform its gun laws.
Less than a month after the shootings, the country's parliament voted by 119 to 1 on reforms banning military-style semi-automatic weapons as well as parts that could be used to build prohibited firearms.
The government offered to compensate owners of newly-illegal weapons in a buy-back scheme.
Ms Ardern has said that "much more" needs to be done to stop radicalisation in the country.
"The challenge for us will be ensuring in our everyday actions, and every opportunity where we see bullying, harassment, racism, discrimination, calling it out as a nation," she said on the first anniversary of the attacks.