A 22-year-old man who turned an August afternoon in Guerneville into a frightening, if brief, episode for people at the local Safeway store was sentenced Friday to nearly a year in county jail and three years of probation for exploding an M-80 under a parked sheriff’s patrol car.

Tristan Avery Proto, of Santa Rosa, pleaded guilty last month to a single felony count of possessing an explosive device Aug. 3, the day he threw an M80 under a patrol car after checking to make sure it was empty, he later told authorities.

In announcing Proto’s sentence, the District Attorney’s Office said Proto suffers from mental health issues and had ingested both drugs and alcohol in advance of the incident.

He had at least two M-80s, one in his backpack and one that he tossed under the car, creating a loud enough explosion that it shook the grocery store windows and caused a panic — particularly given a recent pipe bomb scare on the Monte Rio Beach, authorities said.

Proto was quickly tackled by an off-duty Napa County law enforcement officer and was detained.

He was ordered Friday by Judge Jamie E. Thistlethwaite to serve 360 days in county jail and be released to drug treatment, the District Attorney’s Office said. He also is to serve three years of formal probation.

You can reach Staff Writer Mary Callahan at 707-521-5249 or mary.callahan@pressdemocrat.com. On Twitter @MaryCallahanB.