BUFFALO, N.Y. (AP) — The white gunman who killed 10 Black people in a racist attack at a Buffalo supermarket has been charged with federal hate crimes, according to a criminal complaint filed Wednesday.

Payton Gendron had already faced a mandatory life sentence without parole if convicted on previously filed state charges in the May 14 rampage which also left three survivors — one Black, two white — with gunshot wounds.

U.S. Attorney General Merrick Garland was in Buffalo on Wednesday to visit with the families of 10 Black people killed in a white gunman’s racist attack on a supermarket.

Also read | Woodstock shooting leaves 1 dead as US mulls bipartisan gun law

Gendron is already facing up to life in prison if convicted on state charges in the May 14 rampage, which also left three survivors — one Black, two white — with gunshot wounds.

Gendron’s radical, racist worldview and extensive preparation for the Tops Friendly Market attack are laid out in documents he apparently authored and posted online shortly before the attack.

The documents embrace a baseless conspiracy theory about a plot to diminish white Americans’ power and “replace” them with people of color, through immigration and other means.

Also read | 2 El Monte police officers killed in shooting at motel, suspect ‘down’

The posts detail months of reconnaissance, demographic research and shooting practice for a bloodbath aimed at scaring everyone who isn’t white and Christian into leaving the country.

Gendron drove more than 200 miles (320 kilometers) from his home in a nearly all-white town near the New York-Pennsylvania border to a predominantly Black part of Buffalo. There, authorities say, he mowed down shoppers and workers using an AR-15-style rifle, wearing body armor to protect himself and livestreaming the carnage from a helmet-mounted camera.

The 18-year-old surrendered to police as he exited the supermarket.

Also read | ‘They were good men’: El Monte police chief’s tribute to martyr cops

He has pleaded not guilty to a state domestic terrorism charge, including hate-motivated domestic terrorism and murder.

According to the online documents attributed to Gendron, he had scouted out the supermarket in March, drawing maps and even counting up the number of Black people he saw there.

Federal authorities had said they were considering hate crime charges in the killings, which compounded the unabating toll of gun violence in the United States.

Also read | Who is Pejhmaun Iraj Khosroabadi, man who allegedly shot CHP officer in Studio City?

Ten days after the attack in Buffalo, another 18-year-old with a semi-automatic rifle opened fire at a Uvalde, Texas elementary school, killing 19 children and two teachers.

Soon after, New York Gov. Kathy Hochul signed 10 public safety-related bills, including one prohibiting New Yorkers under age 21 from buying semi-automatic rifles and another that revised the state’s “red flag” law, which allows courts to temporarily take away guns from people who might be a threat to themselves or others.

The U.S. Senate followed on June 12 with a bipartisan agreement on more modest federal gun curbs and stepped-up efforts to improve school safety and mental health programs.