SANTA ROSA (CBS SF) – Sonoma County sheriff’s deputies arrested a registered sex offender Tuesday after he was found in the girls’ bathroom of an elementary school, a sheriff’s sergeant said.

Alan Brelsford, 39, was found in the bathroom by a parent and staff member of the Redwood Adventist Academy elementary school around 8:25 a.m.

READ MORE: UPDATE: Wind-Whipped Big Sur Wildfire Grows To 1,500 Acres, Blaze Erupts Near Geysers Peak In Sonoma

Brelsford, who is registered as a sex offender in Santa Rosa, said he was watching a helicopter when he felt the need to use the bathroom, sheriff’s Sgt. Spencer Crum said.

Alan Brelsford. (Sonoma County Sheriff)

Alan Brelsford. (Sonoma County Sheriff)

He was escorted off the school campus at 385 Mark West Springs Road north of Santa Rosa, and staff members photographed his Chevrolet pickup truck with black rims, Crum said.

Brelsford slowly drove by the school again as sheriff’s deputies were taking a report on the incident. His truck was stopped and he could not provide a good explanation for why he was in the girls’ bathroom or at the school, Crum said.

READ MORE: High Winds Topple Trees; Leave Path Of Destruction In San Jose Neighborhood

Deputies determined he was a registered sex offender out of Sacramento County, where he was convicted in 2006 of exposing himself and masturbating behind the fence of an all-girls private high school in Sacramento, Crum said.

Deputies arrested him for violating the terms of his registration by being on an elementary school campus without lawful business, according to Crum.

Brelsford posted bail and was released from Sonoma County Jail.

The sheriff’s office released his photograph because he is deemed a threat to public safety. Anyone who sees him on school grounds is encouraged to call their local law enforcement agency, Crum said.

© Copyright 2017 by CBS San Francisco and Bay City News Service. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.

MORE NEWS: Pipeline Of Illegal Weapons Shutdown; Four Arrested In San Mateo, Alameda County Raids