Anger briefly turned physical at Payton Gendron's sentencing when a man in the audience rushed at him. The man was quickly restrained; prosecutors later said he wouldn't be charged.
The proceeding then resumed with a more emotional outpouring from people who lost loved ones or were themselves wounded in the attack.
Gendron, whose hatred was fueled by racist conspiracy theories he encountered online, cried during some of the testimony and apologized to victims and their families in a brief statement.
Some angrily condemned him; others quoted from the Bible or said they were praying for him. Several pointed out that he deliberately attacked a Black community far from his nearly all-white hometown.
``You've been brainwashed,'' Wayne Jones Sr., the only child of victim Celestine Chaney, said as sobs rose from the audience. ``You don't even know Black people that much to hate them. You learned this on the internet, and it was a big mistake.''
``I hope you find it in your heart to apologize to these people, man. You did wrong for no reason,'' Jones said.
Gendron pleaded guilty in November to crimes including murder and domestic terrorism motivated by hate, a charge that carried an automatic life sentence.
``There can be no mercy for you, no understanding, no second chances,'' Judge Susan Eagan said as she sentenced him.
Gendron, 19, also faces separate federal charges that could carry a death sentence if the U.S. Justice Department chooses to seek it. His defense attorney said in December that Gendron is prepared to plead guilty in federal court as well to avoid execution. New York state does not have the death penalty.
Gendron wore bullet-resistant armor and a helmet equipped with a live-streaming camera as he carried out the May 14 attack with a semiautomatic rifle he purchased legally but then modified so he could load it with illegal high-capacity ammunition magazines.
Tamika Harper, a niece of victim Geraldine Talley, said she hoped Gendron would pray for forgiveness.
``Do I hate you? No. Do I want you to die? No. I want you to stay alive. I want you to think about this every day of your life,'' she said, speaking gently. ``Think about my family and the other nine families that you've destroyed forever.''
Gendron locked eyes with Harper as she spoke, then lowered his head and cried.
Kimberly Salter, the widow of security guard Aaron Salter, explained that she and her family were wearing ``red for the blood that he shed for his family and for his community, and black because we are still grieving.''
Christopher Braden, a Tops Friendly Market employee who was shot in the leg, said he was haunted by seeing the victims where they lay as he was carried out of the store.
``The visions haunt me in my sleep and every day,'' he said.
Barbara Massey Mapps excoriated him for killing her 72-year-old sister, Katherine Massey. As Mapps shouted and pointed at Gendron, a person in the audience took a few steps toward him before getting held back.
``You don't know what we're going through,'' a man shouted as he was led away by court officers. For several minutes thereafter, family members hugged and calmed each other.
Eagan then ordered Gendron back in and let the proceeding resume after admonishing everyone to ``conduct ourselves appropriately.''
In his short statement, Gendron acknowledged he ``shot and killed people because they were Black.''
``I believed what I read online and acted out of hate, and now I can't take it back, but I wish I could, and I don't want anyone to be inspired by me,'' he said as a woman in the courtroom audience stood up, screamed that ``we don't need`` his remarks and stormed out.
There were only three survivors among the 13 people he shot while specifically seeking out Black shoppers and workers.
His victims at the Tops market included a church deacon, the grocery store's guard, a neighborhood activist, a man shopping for a birthday cake, a grandmother of nine, and the mother of a former Buffalo fire commissioner. The victims ranged in age from 32 to 86.
In documents posted online, Gendron said he hoped the attack would help preserve white power in the U.S. He wrote that he picked the Tops grocery store, about a three-hour drive from his home in Conklin, New York, because it was in a predominantly Black neighborhood.
The mass shooting in Buffalo, and another less than two weeks later that killed 19 students and two teachers at a Texas elementary school, amplified calls for stronger gun controls, including from victims' relatives who traveled to Washington, D.C. to testify before lawmakers.
New York legislators quickly passed a law banning semiautomatic rifle sales to most people under the age of 21. The state also banned sales of some types of body armor.
President Joe Biden signed a compromise gun violence bill in June intended to toughen background checks, keep firearms from more domestic violence offenders and help states put in place red flag laws making it easier for authorities to take weapons from people adjudged to be dangerous.