A man showed up at a Jewish school in Queens armed with a hammer Tuesday morning, broke free of the security guards who had grabbed him and  then assaulted an 8-year-old boy, police sources said.

The boy was shoved into a metal fence, cutting his head. He was not seriously injured. The 42-year-old attacker was arrested.

The incident happened about 10:50 a.m. at the Jewish Institute of Queens on Woodhaven Blvd. in Woodhaven.

Sources said the suspect showed up at the private school holding a hammer. Security was able so stop him and take the hammer away, but as they were leading him out of the building he fought back, broke free and attacked the boy.

The attack comes just days after a man shouting “Allahu Akbar” stabbed an Asian man and a Jewish man in back-to-back broad-daylight attacks on the Upper West Side. The assailant, Raul Morales, is facing up to 40 years in prison for his violent hate crime spree, prosecutors said Saturday.