Warning: Videos contain graphic language

An enraged subway rider attacked a man after the victim’s wife and the attacker got into a protracted argument and she spat at him.

The incident happened on a northbound 5 train at 3:30 p.m. Wednesday. A bystander, who was one of several straphangers yelling at both the woman and the attacker during the entire event, caught it all on video.

“I’m gonna f— your n—– up,” the man screamed over and over again after pummeling the woman’s husband with a series of hard punches and kicks that left him on the floor of the train.

Cops say the argument started in Manhattan, when the woman tried to squeeze into a seat next to a man in a reflective vest. The woman told police that he elbowed her and she elbowed him back and the two launched into a tirade that lasted across the river and four stops into the Bronx.

At Jackson Avenue, the argument escalated, with the woman and man chasing each other around the car and the woman holding the car doors for several minutes as she called for help and the other straphangers yelled at her to calm down and get away from the doors so the train could move. Even the woman’s own husband told her to stop her antics.

“Yo, chill,” he said to her.

But it was too late for the 38-year-old husband as the other man decided to take his frustration out on him and promptly laid him out.

The wife followed the attacker around with her phone up while another woman on the train handed the bleeding husband a hanky. The attacker got off the train at Prospect Avenue and the woman and her husband followed him off, with her yelling for the police.

The man had not been arrested as of Thursday afternoon.