It happened around 7:20 p.m. on May 23 at the Hamilton Township Public Library.
According to investigators, two girls came upon 26-year-old Mitchell Richtman sitting in an aisle between bookshelves.
Authorities say he was committing a lewd act while watching a video on his cell phone.
The girls alerted library staff, who then called police.
As officers arrived, the allegedly saw a suspect matching Richtman's description leaving the library through a basement door.
He was positively identified by the girls, police say, and taken into custody.
Richtman is charged with criminal sexual contact and endangering the welfare of a child.
Report a typo to the ABC13 staff