A Brooklyn straphanger fought off a knife-wielding man aboard a rolling R train, stabbing her attacker with his own switchblade early Friday, cops said.
The encounter began when the victim fell asleep aboard the Bay Ridge-bound subway after a late night of work _ and awoke to find the man masturbating in front of her, police said.
When the 42-year-old woman screamed, assailant Reggie Frank zapped her in the face with pepper spray and pulled the folding knife from his pocket, cops said.
Frank, 47, lunged at her with the blade when the train stopped at the 36th Street station in Sunset Park around 2 a.m., with the woman dodging the knife as she fought for her life.
Their tussle spilled onto the platform, where she gained control of the knife and stabbed Frank in the arm and chest, cops said.
"There was someone on the platform who helped her," said the woman's sister. "She's been sleeping more than anything else. I am beside myself. I can't imagine this happening."
The woman and the suspect were both taken to NYU Langone Hospital in Brooklyn. Frank _ whose lengthy rap sheet includes two 2015 arrests for masturbating on trains _ was charged with assault, weapon possession and public lewdness, police said.
Frank has more than 20 prior arrests, according to police.
The victim was returning home after working late in her job as director of events at an unidentified hotel, according to her sister.
"She's always been strong," the sister said. "I just want (Frank) to be brought up on charges. I want him to be off the streets. I don't want this to happen to another person. It could have been a child."
Frank's arraignment was pending Friday in Brooklyn Criminal Court.