A man shoved a 29-year-old onto the subway rails and whacked him in the face with a metal lock in Brooklyn this week, police said.

The two had been arguing on the train as it arrived at the end of the R line just after 11:30 p.m. on Wednesday, cops said. The fight turned physical inside the 95th Street station where the 29-year-old was punched and pushed onto the tracks, according to police.

A video released by police Sunday shows a bearded man with long dark hair screaming at the 29-year-old, who at one point lays down on the tracks. The bearded man can be seen holding a string with a silver lock on the end.

While the man was caught on video touching and standing near the electric third rail, cops said an MTA worker had already killed the power.

Good Samaritans eventually helped the man back up. That’s when the bearded man walked up and smacked the 29-year-old in the face with the lock, police said.

The victim was taken to NYU Langone Hospital where he was in stable condition.