PARK SLOPE, Brooklyn (PIX11) — An on-duty MTA worker shot a man who threatened him and his coworker during a dispute at a subway station in Brooklyn Tuesday night, police said.

The shooting happened at the Union Street station in Park Slope around 9 p.m., according to the NYPD.

A 39-year-old man allegedly approached two on-duty MTA employees who were waiting for a train on the southbound R train platform at the Atlantic Street station and started an argument with the workers, according to NYPD Chief of Transit Michael Kemper.

One of the MTA workers was a revenue electronic maintainer who fixes MetroCard machines. The other MTA worker was a transit revenue collector who was armed and serving as security for his coworker, according to Kemper.

“The male became irate and threatened to beat them up. As the train arrived, the male followed the two MTA employees and continued to threaten the unarmed employee while his partner tried to calm the male down,” Kemper said.

The two MTA workers got off the train at the Union Street station, but the irate man followed them to the mezzanine level of the station, police said.

“As they reached the mezzanine area of the station, the male began to advance towards the two MTA employees,” Kemper said. “The armed MTA worker pulled out his firearm while repeatedly giving verbal commands for the male to back up. The male failed to comply and threatened to forcibly remove the firearm from the MTA employee.”

The MTA worker fired one shot, hitting the man in the chest, according to police. The man was hospitalized and remained in critical condition as of Wednesday morning. The 39-year-old man was unarmed, police said.

The two MTA workers were not injured during the incident, authorities said. The MTA worker who shot the man is a 21-year veteran, according to NYC Transit President Richard Davey.