BROOKLYN (PIX11) — Shia Hersh Glick, the Williamsburg man who was shot while protecting his family when a Palestinian man opened fire in Jerusalem on Sunday, is lucky to have survived the harrowing ordeal, according to his rabbi.

Glick was shot in the neck and the bullet missed his artery by less than the thickness of a hair, Rabbi Moishe Indig told PIX11 News Monday. The Brooklyn man is no longer in critical condition and does not need surgery, the rabbi added.

“The doctors called it a miracle,” said Moishe, a leader of the Satmar Jewish community in Brooklyn. “The bullet just missed the artery by millimeters.”

The rabbi said the Glick family is in stable condition at a Jerusalem hospital. Glick’s 19-year-old son, Burich, was shot in the arm and needs a second surgery, but the injury is not life-threatening, Moishe said. Burich is engaged and is getting married in November.

The family was on a week-long trip in Jerusalem when the shooting occurred.

“I was very saddened. It was devastating,” Moishe said. “Unfortunately, this is not surprising, but when it comes this close to home, it’s devastating … We need prayers for all the victims.”

A pregnant Brooklyn woman who was shot in the abdomen was among the eight victims when a gunman opened fire at a bus near Jerusalem’s Old City. The attack in Jerusalem followed a tense week between Israel and Palestinians in Gaza and the West Bank.

Last weekend, Israeli aircraft unleashed an offensive in the Gaza Strip targeting the militant group Islamic Jihad and setting off three days of fierce cross-border fighting. Islamic Jihad fired hundreds of rockets during the flare-up to avenge the airstrikes, which killed two of its commanders and other militants. Israel said the attack was meant to thwart threats from the group to respond to the arrest of one of its officials in the occupied West Bank.

Forty-nine Palestinians, including 17 children and 14 militants, were killed, and several hundred were injured in the fighting, which ended with an Egyptian-brokered cease-fire. No Israeli was killed or seriously injured.

The Islamic militant group Hamas, which controls Gaza, stayed on the sidelines.

A day after the cease-fire halted the worst round of Gaza fighting in more than a year, Israeli troops killed three Palestinian militants and wounded dozens in a shootout that erupted during an arrest raid in the West Bank city of Nablus.