Nineteen minutes before the first 911 call alerted the authorities to a mass shooting, a hate-filled, anti-immigrant manife sto appeared online. The authorities have said that it was written by the suspect; it said he was carrying out the attack in “response to the Hispanic invasion of Texas.” The deadliest attack to target Latinos in modern American history, the shooting in El Paso, a city that is 80 percent Hispanic, has deeply disturbed Latinos across the United States.

The suspect told investigators soon after his arrest that after driving more than 10 hours from Allen to El Paso, he had become lost, and then drove to Walmart because he was hungry, according to court documents. He also told investigators that he had used an AK-47-style rifle and brought multiple magazines with him from Allen to carry out the killings.

His mother had called the Allen Police Department in the weeks before the shooting, asking whether her son was mature enough to handle the rifle he had recently ordered. The police told her that, according to the law, her son was allowed to have the weapon , a lawyer for his family has said.

A lawyer for Mr. Crusius could not be immediately reached for comment on Thursday. His court-appointed lawyer, Mark Stevens, has previously said that he would use “every legal tool available” to prevent his client from being executed. Mr. Crusius is being held without bond, the authorities said.