Before carrying out the attack, the 19-year-old posted a racist manifesto online. Three people were also injured.
An avowed white supremacist who killed ten black shoppers and employees at a Buffalo supermarket has pleaded guilty to murder and hate-motivated terrorism charges.
Payton Gendron, 19, drove three hours from his home near Binghamton, New York, to the Buffalo Tops Friendly Markets store.
Gendron, who was dressed in military gear, opened fire with an AR-15 style semi-automatic assault-style rifle after arriving at the supermarket.
In the attack, which occurred in May of this year, he killed ten people and injured three others.
Police say Gendron left a racist manifesto online before the attack in which he admitted to targeting the town due to it being a predominately black neighbourhood, a court heard.
In court, Gendron admitted all the charges against him, including murder, murder as a hate crime and hate-motivated domestic terrorism, which carries an automatic sentence of life without parole.
Gendron also admitted wounding three people who survived the attack, which happened in May this year.
The teenager, who was handcuffed and wore an orange jumpsuit, showed little emotion through the 45-minute proceedings, which took place in a courthouse just two miles from the scene of the shooting.
Gendron will spend the rest of his life behind bars, as he faces a sentence of life in prison without parole. The state of New York does not have a death penalty.
A sentencing hearing is expected at a later date.
A separate indictment returned in U.S District Court in July charged Gendron with 27 federal hate crimes and firearms offences, for which he could face the death penalty if convicted.
Following the attack, police were praised for responding less than two minutes after the incident started.
Buffalo mayor Byron Brown said more lives probably would have been lost if it was not for their “swift response” and “courageous actions”.