The gunman who killed 10 black people in an attack at a Buffalo supermarket in the US was charged today with federal hate crimes and could face the death penalty if convicted.

The criminal complaint filed against Payton Gendron coincided with a visit to Buffalo by Attorney General, Merrick Garland.

Garland met with the families of those killed and placed a bouquet of white flowers outside the store that was the scene of the May 14 attack.

Garland did not rule out seeking the death penalty, saying the department would follow its procedures of weighing whether to seek such a punishment and that the families and survivors will be consulted in the process.

Gendron was already facing a mandatory life sentence without parole on previously filed state charges in the rampage.

The federal hate crimes case is based partly on documents in which Gendron laid out his radical, racist views and extensive preparation for the attack, some which was posted online.