▶ Watch Video: El Paso marks 2 years since mass shooting inside Walmart

Patrick Crusius pleaded guilty on Wednesday to federal hate crimes and firearms charges for killing 23 people inside a Walmart in El Paso in 2019, one of the deadliest mass shootings in U.S. history. 

The guilty plea came amid prosecution delays that have made the case drag on for more than three years. In January, federal prosecutors decided not to pursue the death penalty. The 24-year-old could still face the death penalty over separate state charges.

Although the federal and state cases have progressed along parallel tracks, it is now unclear when Crusius might face trial on state charges.

The district attorney who had been leading the state case, Yvonne Rosales, resigned in November over accusations of incompetence involving hundreds of cases in El Paso and slowing down the case against Crusius. Texas Gov. Greg Abbott appointed a new district attorney in December to “restore confidence” in the local criminal justice system.

The shooting happened on a busy weekend in August at a Walmart in El Paso popular with shoppers from Mexico and the U.S. In addition to those killed, more than two dozen were wounded and hundreds more were scarred by being present or having a loved one hurt.

Crusius surrendered to police after the attack, saying, “I’m the shooter,” and that he was targeting Mexicans, according to an arrest warrant. Prosecutors have said he published a screed online shortly before the shooting that said it was “in response to the Hispanic invasion of Texas.”