The suspect in the El Paso shooting stepped out of a vehicle with his hands up and declared “I’m the shooter” when he was arrested minutes after the massacre at a Walmart that killed 22 people, the police said in an affidavit filed Friday.

The suspect, Patrick W. Crusius, 21, who is white, also divulged to the police that he had targeted Mexicans, according to the document, written by Detective Adrian Garcia of the El Paso Police Department.

While responding to reports of an active shooter on Saturday morning, the document said, rangers with the Texas Department of Public Safety saw a vehicle stop at an intersection near the Walmart. It said a man exited the vehicle and admitted opening fire on customers and employees in the store.