The perv who exposed his genitals to a bystander on the subway last week has turned himself in, according to cops.

A 28-year-old passenger was seated on a northbound 6 train at 125th Street and Lexington Avenue about 10 p.m. Sept. 6 when Matthew Cespedes, 22, of the Bronx was allegedly pleasuring himself in front of the woman, cops said.

The woman captured a photo of the man before he fled, cops added.

Cespedes was charged with forcible touching, public lewdness, sexual abuse and harassment.