EL PASO, Texas — A Texas man pleaded guilty Wednesday to federal charges accusing him of killing nearly two dozen people in a racist attack at an El Paso Walmart in 2019, changing his plea weeks after the U.S. government said it wouldn’t seek the death penalty for the hate crimes and firearms violations.

Patrick Crusius, 24, pleaded guilty Wednesday to 90 charges in connection with the Aug. 3, 2019, mass shooting, one of the deadliest in U.S. history. He still faces a potential death sentence if he’s convicted on a state capital murder charge in the shooting that killed 23 people.

The judge read each count, which included naming the 23 victims’ names. Those killed and wounded were from the U.S. and Mexico. Handcuffed and wearing a dark blue jumpsuit, Crusius showed no emotion. “I plead guilty,” Crusius said.

Federal prosecutor Ian Martinez Hanna was visibly shaken and holding back emotions as he described the shooter’s actions on the morning of the attack. Crusius nodded his head affirmatively as Hanna described how the defendant killed nearly two dozen people.

Hanna detailed the timeline of events starting with the shooter driving to El Paso and parking in the Walmart parking lot.

AFTER EL PASO WALMART SHOOTING:debate over domestic terrorism law rages on. Here’s why.

Prosecutors announce:Feds will not seek death penalty in El Paso Walmart shooting that killed 23

Crusius then got out of his vehicle and began shooting people in the parking lot, Hanna said. He then continued into Walmart, where he fatally shot nine people in a bank inside the store. He then continued shooting another nine in the aisles of the store.

Crusius then left the store and minutes later surrendered to law enforcement.

Hanna said during the hearing that the shooter admitted to being a white supremacist. He also told investigators he was motivated to commit the shooting after reading “The Great Replacement,” which is a white nationalist conspiracy theory.

Crusius committed the mass shooting in an effort to dissuade Mexicans and other Hispanics from coming to the U.S., Hanna said. The shooter said “they (Mexicans and other Hispanics) were to blame” and “he was trying to defend his country,” Hanna said.

The shooter said he came to El Paso because the border city was far from where his family lives in Allen, Texas, Hanna said during the hearing.

The El Paso Walmart was selected because the shooter believed people of Mexican or Hispanic country origins would be at the store, Hanna said. His alleged statements echoed both the anti-immigration rhetoric of American politics and racist screeds put out by other mass shooters in the U.S. and abroad.

Ex-El Paso mayor after hearing: ‘I wish we had the death penalty’

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

Many of the dead and wounded were citizens of Mexico.

Former El Paso Mayor Dee Margo, who attended the hearing, said it was a gut-wrenching day and called the shooter an “evil white supremacist.”

“It was tough,” Margo said. “I wish we had the death penalty. It should have happened two years ago at a minimum.”

Margo added he hopes state prosecutors will continue to seek the death penalty against the shooter.

Immigration debate 

More than three years after the shooting, the description of an “invasion” on the U.S.-Mexico border by Republicans has continued in American politics, angering Democrats and immigrant rights groups.

From campaign stumps to hearings in Congress, Republicans have increasingly described high numbers of migrant crossings into the U.S. as an invasion threatening public safety and overwhelming border communities. Critics have condemned the characterization as anti-immigrant and dangerous in the aftermath of El Paso and other racially motivated attacks.

Republican Gov. Greg Abbott was criticized for a fundraising mailer dated the day before the attack calling on his supporters to “defend Texas” from immigrants entering the country illegally. He responded at the time by saying “mistakes were made” over the mailer, though did not elaborate or assign fault.

But Abbott has more recently embraced using the word “invasion” while authorizing a series of hardline immigration measures, including a letter to state police and the Texas National Guard in November with the subject line “Defend Texas Against Invasion.”

Abbott has defended his statements by saying he is invoking language included in the U.S. Constitution. Some legal scholars have called it a misreading of the clause.

Mass shootings in the United States

A database of mass killings in the U.S. since 2006 compiled by The Associated Press, USA Today and Northeastern University shows that the number of deadly mass shootings linked to hate crimes has increased in recent years. Among 13 prominent instances, the 2019 Walmart shooting was the deadliest. The database tracks every mass killing — defined as four dead, not including the offender — in the U.S. since 2006.

Contributing: The Associated Press