A 26-year-old New Jersey man was arrested Tuesday for engaging in a sexual act at the Hamilton Township Public Library, police said.

The man, Mitchell Richtman of East Windsor, was charged with criminal sexual contact and endangering the welfare of a child after two girls spotted him in what police described as a "lewd act" between two rows of bookshelves, according to Hamilton police.

Richtman was viewing a video on his cellphone at the time, police said in a news release.

Police arrived at about 7:20 p.m. and detained him as he was leaving the library through a basement door and the juvenile girls positively identified him.

Samantha Marcus may be reached at smarcus@njadvancemedia.com. Follow her on Twitter @samanthamarcus. Find NJ.com Politics on Facebook.