A Coram sex offender was arrested Tuesday after authorities said he exposed himself to girls in front of an elementary school and inside a Target store earlier this month, Suffolk police said.

Police said in a news release that Ray Sanchez, 31, was committing a sex act in his car, which was parked in front of Setauket Elementary School the morning of Oct. 15, as two 13-year-old girls walked by, police said.

advertisement | advertise on newsday

On Oct. 10, police said, Sanchez exposed himself to an 8-year-old girl who was with her mother at the Target, 2975 Horseblock Rd. in Medford.

"The woman was able to take several pictures of the suspect before he fled the store," police said.

Sanchez, of 4 Summercress Lane, is a registered level 2 sex offender. He was charged with three counts of endangering the welfare of a child, exposure of a person, and public lewdness. Sanchez is scheduled to be arraigned Wednesday at First District Court in Central Islip.