The judge set bail at $1 million for Leslie Allen Merritt Jr. after a prosecutor said he presents a danger to the community.
Merritt, a 21-year-old landscaper, then asked the judge if he could speak. After the judge warned him that anything he says could be used against him, Merritt said he's not the shooter and that he had no access to his gun because it's been in a pawn shop for two months.
Police say he shot four cars on Aug. 29 and 30 on Interstate 10 in Phoenix and they have forensic evidence linking his gun to the shootings.
A spokesman for Gov. Doug Ducey says Merritt was taken into custody around 7 p.m. Friday at a Wal-Mart in Glendale, a suburb west of Phoenix.
Arizona Department of Public Safety director Col. Frank Milstead says Merritt is in custody because the weapon he owns is forensically linked to the crimes.
Copyright 2015 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.