A robber on a moving train in Manhattan Saturday stabbed a rider who resisted and managed to club his attacker on the head, the NYPD said.

The attack happened on a southbound C train approaching the 59th Street-Columbus Circle station at about 6 a.m., police said.

Police said the alleged robber — Jamel Purnell, 39, of Manhattan — had already robbed another subway passenger, taking the man’s cellphone and backpack.

When Purnell then tried to rob a 61-year-old man, a struggle ensued, and Purnell stabbed the man in the abdomen, the NYPD said.

The victim ended the attack by hitting Purnell on the head with an object, possibly a pipe, said Det. Annette Shelton, an NYPD spokeswoman.

With the train in motion, the victim reported the attempted robbery to the conductor, who radioed police. Officers waiting at the 59th St. station detained and arrested Purnell, police said. Criminal charges are pending.

Purnell and the unidentified victim were taken to hospitals for treatment of non-life-threatening injuries.

Not guilty plea in Gilgo Beach murder ... Woman killed in LIE crash ... Newsday probes LI police use of force Credit: Newsday

Rain, strong winds eye LI ... Not guilty plea in Gilgo Beach murder ... Woman sentenced in brothel case ... Let's Go: Holidays in Manorville

Not guilty plea in Gilgo Beach murder ... Woman killed in LIE crash ... Newsday probes LI police use of force Credit: Newsday

Rain, strong winds eye LI ... Not guilty plea in Gilgo Beach murder ... Woman sentenced in brothel case ... Let's Go: Holidays in Manorville

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME