Authorities say the 21-year-old man accused of carrying out the deadly mass shooting at an El Paso Walmart confessed after surrendering and said he had been targeting Mexicans.

El Paso Detective Adrian Garcia said in an arrest warrant affidavit that Patrick Crusius emerged with his hands up from a vehicle stopped at an intersection shortly after last Saturday’s attack and told officers, “I’m the shooter.”

He says Crusius later waived his Miranda Rights and agreed to speak with detectives, telling them he was targeting Mexicans during his attack.

Twenty-two people were killed in the attack and about two dozen others were wounded. Many of the dead had Latino last names and eight of them were Mexican nationals. El Paso sits on the border with Mexico.