Palestinian militants have agreed to stop firing rockets into Israel after dozens of militant sites across the Gaza Strip were hit with retaliatory airstrikes.

The Israeli military said it had struck around 80 sites, including a security headquarters building, after militants fired 30 rockets in the heaviest exchange of fire between the bitter enemies in several weeks.

The Palestinian Islamic Jihad, one of the armed groups operating in Gaza, said it had fired the rockets in retaliation to Israel’s killing of four Palestinian protesters on Friday near the border dividing Hamas-ruled Gaza and Israel.

Less than 24 hours later, the group said it had agreed to a ceasefire in response to the efforts of Egyptian meditators, who have been in the region for weeks attempting to secure calm and prevent a full-blown war.

Daoud Shehab, a spokesperson for the Iranian-backed group, said that his movement was immediately halting the rocket attacks.

“After contacts between the Islamic Jihad leadership and the brothers in Egypt it was agreed that a comprehensive ceasefire will begin immediately,” he said. “The Islamic Jihad will abide by the ceasefire if the occupation does the same.”

Palestinians check the damage to buildings destroyed by Israeli airstrikes (AP/Khalil Hamra)

Israeli military spokesperson Lieutenant-Colonel Jonathan Conricus earlier accused Syria and Iran of involvement in the night-long barrage of rocket attacks and threatened to strike Iranian targets in Syria in response.

He said the Palestinian militant group Islamic Jihad was behind the rocket fire, after receiving orders from Iran’s “al-Quds” force based in Syria.

“Orders and incentives were given from Damascus with a clear involvement of the Iranian Revolutionary Guard’s al-Quds force,” he said. “Our response is not limited geographically.”

Smoke rises from an explosion caused by an Israeli airstrike in Gaza City on 27 October (AP/Hatem Moussa)

Since 30 March, hundreds of thousands of Gazans have marched each week on the heavily fortified border between Gaza and Israel demanding the right to return to lands they fled and were forced from after the 1948 war, which resulted in the formation of Israel.

In recent years they lost the battle for most of their remaining land, as Gaza has been carved off the West Bank where Jewish settlement increases by the day.

Palestinians have said they are peacefully demonstrating during the Great March of Return protests.

A Palestinian boy stands amid the rubble of buildings destroyed by Israeli airstrikes (AP/Khalil Hamra)

But Israel has accused militant group Hamas of encouraging protesters to be violent towards their soldiers, to cut the border fence and to launch raids inside Israel.

Israel has previously reduced Palestinian fishermen’s permitted fishing zone by a third, cutting it from nine nautical miles to six, in response to border protests.

The Israeli army also previously closed Kerem Shalom ­– the sole goods crossing between Israel and Gaza.

Since the marches began six months ago, at least 160 Palestinians present or taking part in the protests have been killed.