Dayton mass shooter Connor Betts had cocaine, Xanax and alcohol in his system when he killed nine people with an assault rifle, police revealed Thursday.

Dayton police said Betts had “a pipe device and a baggie of cocaine” on him after he was shot dead by cops during the Aug. 4 massacre in Dayton’s trendy Oregon District.

A preliminary autopsy determined that officers fired at least two dozen shots at Betts, striking him through “gaps” in his body armor, according to Montgomery County Coroner Kent Harshbarger.

The autopsy also found that two of the victims were hit by bullets fired by the police officers and one of them died — but that the cops did not fire the lethal shots.

“While it weighs heavily on us that our response caused harm to these victims, we are comforted that none of our rounds caused the death of any of these innocent people,” Dayton Police Chief Richard Biehl said, police said on Twitter.

Police said Betts socialized with his 22-year-old sister, Megan, and a friend before heading back to his car, where he put on a hoodie, body armor and grabbed a backpack with an assault rifle and ammunition before opening fire on Dayton’s Oregon District nightlife strip.

His sister was among the first to be killed, but police cannot agree whether she was a target — nor have police determined a motive for the bloody rampage.

The shooting came one day after a Texas man walked into an El Paso Walmart and opened fire with an assault rifle, killing 22 people. Patrick Crusius told police he was targeting “Mexicans.”