A Molotov cocktail was hurled at two Israeli rabbinical students as they walked in Midtown, and cops are investigating the incident as a possible hate crime, said law-enforcement sources and witnesses Sunday.

The unidentified attacker hurled a glass Snapple bottle filled with some type of accelerant at Yosef Rachimi and Yisrael Gadasi, both 19, near the corner of West 37th Street and Ninth Avenue around 1:30 p.m. Friday, sources said.

“I’m in complete shock,” Rachimi told The Post through a translator Sunday. “In 2015, an explosive bottle was thrown at a Jew in the streets of New York.”

Rachimi and Gadasi, who are in the city doing a year of study at a Brooklyn yeshiva, are well-known in the neighborhood for going around to Jewish-owned businesses to urge people to perform mitzvahs, or good deeds, community leaders said.

“It is conceivable that the attacker sees these boys every Friday and prepared this bomb to ambush them. A firebomb is not the kind of thing you have sitting in your car or in your bag unless you have someone to throw it at,” said Barry Sugar, director of the Jewish Leadership Council.

A shopkeeper from a nearby business saw the maniac light the bottle before smashing it on the pavement and running off.

“He lit something in the bottle — I think alcohol,” said shop owner Salem Hegazy, who rushed to douse the flames with water.

“The bottle broke on the floor, and the fire came up,” he said.

“Some people walked by, and they called the Fire [Department].”

Neither Rachimi nor Gadasi was injured.

Police were called to the scene shortly after the incident, and detectives with the NYPD’s Hate Crimes Task Force later interviewed the men.

Meanwhile, police were investigating another possible bias attack in Brooklyn after an Orthodox Jewish mother had unknown objects hurled at her as she pushed a baby carriage past the Bangladesh Muslim Center in Kensington on Saturday, police said.

The 22-year-old woman was not injured, and no arrests have been made.

Additional reporting by Dana Sauchelli