"One of the suspects did say they were very bored," said Deputy District Attorney Danielle London.
"And so they did it?" asked ABC7's Vic Lee.
"And so they did it," said London.
London said that was the motive the two men gave for the highway pellet gun shootings.
Police received a tip which led to Thursday night's arrest of Shawn Wagner of Mariposa and Rojelio Gomez of Fremont. They are both 21 years old and have no criminal record.
Gomez works at Stanford Medical Center. A spokesman told ABC7 he's been placed on unpaid administrative leave.
They're charged with shooting at cars traveling on Highway 680 near the Fremont-Sunol border and along Interstate 880.
"The suspects both admitted to shooting at the other cars driving by on the various freeways," said London.
Over the last month, more than 40 drivers told the CHP that their vehicles had been struck with pellets on 680. Nine other shootings were reported on 880.
The pellets damaged vehicles, hitting door panels and shattering windows. One person suffered minor injuries.
London says the suspects only admitted to using pellet guns, but police believe they also used a high-powered air rifle, which is a more serious crime.
Drivers were relieved that arrests had been made.
"I was a little bit worried, like, I'm going to get shot someday, yeah," said Raoul Palamino.
"I'm glad they caught somebody because we have four kids," said Laura Aquilar.
Wagner and Gomez have been charged with 42 counts of assault with a deadly weapon and 43 counts of felony vandalism. They will be arraigned next Tuesday.