A subway rider was shoved toward the tracks in Harlem by aman who said he hates “white people” — and hours later, a train operator was the victim of a similar attack in lower Manhattan, police sources said.

The terrifying assaults come amid a rash of pushing, jumping and falling incidents in the subway system that has officials exploring the addition of barriers on platforms.

Gary Weeks, 51, who is black, approached a 28-year-old white man as he was waiting on the northbound 4 train platform at 125th Street around 1 p.m. Monday and and allegedly said: “I don’t like white people,” police sources said.

Weeks then grabbed the victim and tried to shove him onto the tracks, the sources said.

The man was able to break away from the attacker, with the aid of a good Samaritan, and called for help.

Weeks allegedly remained violent after police showed up and even spat in an officer’s face before being brought under control.

He was taken to Metropolitan Hospital for a psychiatric evaluation, and was charged with attempted murder as a hate crime.