CHRISTCHURCH, New Zealand — The gunman who attacked worshipers at two New Zealand mosques last year, killing 51 people and injuring 49, faced his surviving victims and relatives of the deceased in a courtroom on Monday as harrowing new details of the killing rampage emerged.

A judge this week is determining the sentence for Brenton Tarrant, who pleaded guilty in March to dozens of counts of murder and attempted murder and one count of committing a terrorist act in connection with the March 15, 2019, massacres at the Al Noor Mosque and Linwood Islamic Center in Christchurch. The 29-year-old Australian had posted white-supremacist views online and live-streamed the slaughter on Facebook.

A white supremacist who killed 51 people at two mosques in New Zealand in 2019 watched on Aug. 24 as relatives of his victims recalled the horror of the attack. (Reuters)

The attacks — the worst acts of violence in New Zealand’s modern history — shocked a nation accustomed to low crime rates and little history of terrorist activity, and spurred Prime Minister Jacinda Ardern to tighten gun laws.

As the hearing began Monday under social distancing restrictions and with police snipers positioned on the court’s roof, prosecutor Barnaby Hawes said Tarrant had studied the mosques’ layouts and exit routes to maximize casualties and had contacted his family about his planned deeds shortly before he began his assault.

Tarrant sat impassively in the dock, his head often bowed, as details of his crimes were read out. He glanced occasionally around the courtroom but showed little reaction as survivors relived the horror.

“The gunman and I looked into each other’s eyes. . . . I was shot nine times,” said Temel Atacocugu, looking at Tarrant as he recounted the carnage at the Al Noor Mosque.

“I laid under bodies in the mosque, thinking I was going to die,” he said. “I tried to lie as still as possible when the gunman came back a second time. I could feel the blood and brains of the person above me running down my face and neck. I couldn’t move or make a sound, as the gunman would have executed me.”

Gamal Fouda, the mosque’s imam, who was delivering a sermon on the day of the attacks, said he had “lived with the nightmare” of what he witnessed, explaining how he had tried to be strong for his community despite his trauma.

“We are a peaceful and loving community who did not deserve your actions,” he told Tarrant. “If you have done anything, you have brought the world community closer with your evil actions.”

Tarrant carried six weapons with him for the assault, including rifles and semiautomatic shotguns. The youngest victim of Tarrant’s rampage was 3 years old.

Previously unreported details came to light Monday, including information from Tarrant’s interview with police after his arrest in which he described his actions as terrorist attacks motivated by his ideological beliefs. Hawes said Tarrant told investigators that he wished he had killed more people and that he intended to use incendiary devices found in his car to burn down the mosques following the massacre.

Mohammad Atta Ahmad Alayan, who was shot in the head and shoulder, recited the Muslim al-Fatiha prayer in court before weeping as he described the “devastating” news of learning, three days after the attacks, that his son Ata had died.

Maysoon Salama, Ata’s mother, asked Tarrant to look up her son’s name, so he would “know the huge loss you caused.”

“I can’t forgive you,” she told the gunman. “You thought you could break us; you failed miserably.”

But Janna Ezat said she had forgiven the man who killed her son, Hussein al-Umari.

“I weep every day for him and for my family’s loss,” she told the court. “I decided to forgive you, Mr. Tarrant, because I don’t have hate, I don’t have revenge. Hussein will never be here [again], so I have only one choice: to forgive you.”

Earlier, Judge Cameron Mander began by noting that many of the victims’ relatives had been unable to attend the hearing at the Christchurch High Court because of coronavirus restrictions, acknowledging that this had contributed to their stress. He also outlined restrictions on reporting for those registered to view proceedings either in person, in overflow courts or remotely through a live stream.

Tarrant, who changed his initial plea to guilty earlier this year, faces a maximum possible sentence of life in prison without parole. The judge is expected to hand down the sentence by Thursday.

Before the hearing, Abdul Aziz Wahabzadah, who fought off Tarrant at the Linwood Islamic Center, said in a telephone interview that it was important for him to be in court on Monday to see the attacker whom he managed to frighten away, saving lives in the process.

“He came and killed all the innocent women and children with a gun, but when his turn came [for a beating], he ran away like a coward,” Wahabzadah said.

He said he wanted to see Tarrant attempt to explain “why his life is more important than the lives of those kids.”