Authorities say the incident happened at the San Bernardino County Library Needles Branch on Monday afternoon.
Caleb Brooks was identified as the suspect in the case on Tuesday and was arrested at his home for lewd or lascivious acts with a minor under 14. He is being held on $25,000 bail.
No further details were released. The case is being reviewed by the district attorney's office.
Anyone with information is urged to call WE-TIP at (800) 78-CRIME.