F train riders stood up to a man verbally abusing two women wearing hijabs Monday morning. View Full Caption Flickr/Michael Candelori

Riders on a Manhattan-bound F train banded together to confront a man who was harassing two Muslim women the day after a gunman, who had reportedly pledged allegiance to ISIS, killed 49 people and injured dozens more at a gay nightclub in Orlando, Fla.

The man yelled for "two terrorist foreigners" — two women wearing the traditional Muslim veil, or hijab — "to go back where they came from" as he boarded the packed train with a child in a stroller in Jackson Heights, on Monday morning, the witness said.

"The entire train erupted in anger," Amaira Hasan wrote in a post on Facebook. She was on her way from her home in Jamaica Estates to her office in the Flatiron district when she witnessed the event.

"A black man, a Romanian, a gay man, a bunch of Asians, and a score of others came to their defense demanding that this man leave these women alone and get off this train," she said.

The man continued to issue insults, telling the Muslim women to take their bombs home with them and voicing support for Republican presidential candidate Donald Trump's anti-immigration policy until one straphanger's words shushed him.

"This is New York City. The most diverse place in the world," the man declared, according to Hasan. "And in New York, we protect our own and we don't give a f**k what anyone looks like or who they love, or any of those things. It's time for you to leave these women alone, Sir."

The man was escorted off the train at the 21st Street-Queensbridge station, although it's unclear whether a train conductor was involved, she told DNAinfo in an interview.

The MTA has no record of the incident, a spokesperson said.

Hasan, who practices Islam but doesn't wear a hijab, said she was surprised but proud to see her fellow New Yorkers defend two Muslim women not long after the Orlando massacre.

”In troubling times, people are scared," she said, "but it’s nice to see that end of the day, people are looking out for one another, and I think that’s what’s important.”

Hasan's post first circulated the Internet in a tweet posted by Rebecca Katz, a partner at Hilltop Public Solutions.