A woman fought off a man who police say tried to push her in front of a moving subway in Downtown Brooklyn on Thursday.

Police arrested 46-year-old David French, who is homeless, and charged him with reckless endangerment.

The incident happened at the Borough Hall station around 8 p.m., when the 27-year-old victim was standing on the northbound 4/5 platform. Authorities say the suspect started yelling at her to leave the station, then followed her as she walked away.

Police say French moved behind her and gave her a hard shove toward the subway tracks, but she was able to grab a pillar to avoid falling into the path of an oncoming train.

When the subway arrived, she got on and rode to the 14th Street-Union Square station, where she found officers from the NYPD Transit District. They broadcast a description of the suspect over the radio, and French was located at Court and Joralemon streets.

He has prior arrests, including for slapping a person in the face and leg while riding a subway train in 1994.

He reportedly lives at Lexington Avenue Homeless Shelter in Harlem and has a history of interaction with police for mental health issues.