Police say he did it in front of three boys at the YMCA.
Frederick Police have charged a Westminster man with numerous counts of indecent exposure.
John Rinehart, 68, of the 4000 block of North Stone Road, was taken into custody on Sunday afternoon at the YMCA in Frederick.
Authorities say Rinehart approached three male juveniles in the locker room. He smiled at them, and opened up a towel, exposing himself, according to the youths.
He was detained by YMCA employees until police officers arrived.
Rinehart was taken to Central Booking for processing.