Police are looking for a homophobic maniac who swung a hammer at a straphanger on a subway platform and tossed him onto the tracks.

The suspect called the 21-year-old victim a “fu–ing fa–t” when he attacked him at the Tremont Avenue B/D station at 1 a.m. on Nov. 22, a police source said.

The suspect then lunged at the man and threw him onto the track bed.

Good Samaritans on the platform flagged down the motorman of an arriving train, who stopped in time to avoid running him over.

Medics rushed the man to Saint Barnabas Hospital, where he was treated for lacerations to the head.

The unidentified suspect is at large, police said. The NYPD’s hate-crime task force is investigating the attack.