A man was in critical condition Thursday night after being shot in the head on a subway train as it arrived at the Hoyt-Schermerhorn station in Downtown Brooklyn during the Thursday evening rush hour, the authorities said.

The shooting occurred after a 32-year-old man boarded a northbound A train at the Nostrand Avenue stop at about 4:45 p.m., Michael Kemper, the Police Department’s Chief of Transit, said at a news conference.

As the train left the station, the man was confronted by a 36-year-old man who witnesses described as acting in an “aggressive and provocative” manner, Chief Kemper said.

What started as a verbal confrontation quickly become a physical fight, the chief said, with the 36-year-old man displaying either a knife or razor blade at one point. Eventually, he pulled out a gun, Chief Kemper said.

The men began grappling, and the 32-year-old man grabbed the gun and shot the other man several times, Chief Kemper said. He said he did not believe the two men knew each other.

Footage of the fight posted to social media shows that the 36-year-old man repeatedly threatens the 32-year-old man, standing over him and saying “I will beat you up” before the younger man stands up and the two circle around each other. As the fight escalates, other passengers move to the opposite end of the train, but one woman stays back.