Police cuffed Gary Weeks, 51, of Wavecrest for the bizarre attack Monday at 2 p.m. at the 4-5-6 subway station at 125th St. and Lexington Ave., officials said to source.
The straphanger was waiting for a northbound train when Weeks walked up to him and tried to push him onto the tracks.
The victim got away from Weeks, as other people started pointing and yelling at the attacker to simmer down.
He then began yelling about his hatred for whites.
Once cops closed in and cuffed him, he spit on one officer, police said.
Weeks was charged with attempted murder, aggravated harassment and obstruction of government administration.