An avowed white supremacist who carried out a deadly mass shooting at a supermarket in Buffalo has pleaded guilty to murder and hate-motivated terror charges.

Payton Gendron, 19, drove for three hours from his home near Binghamton, New York state, to the Tops Friendly Markets store in Buffalo, where he opened fire with an AR-15-style semi-automatic assault-style rifle.

The teenager, who was wearing military-style body armour at the time, shot dead 10 people and injured three others in the attack in May this year.

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.

Eleven of Gendron’s victims were black.

Those killed ranged in age from 32 to 86 and included an armed security guard who died trying to protect customers, a church deacon and the mother of a former Buffalo fire commissioner.

In court, Gendron admitted all the charges against him, including murder, murder as a hate crime and hate-motivated domestic terrorism.

More from US

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 in Erie County, 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 a US 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”.