Violence has flared up between Israel and Gaza, with the Israeli air force killing four Palestinians and Palestinian militants firing rockets far across the border.

The fighting erupted on Thursday when an air strike on a car killed two militants, one of them from Gaza's governing Islamist group Hamas, whom Israel accused of planning to send gunmen to attack it through the neighbouring Sinai region of Egypt.

Palestinian militants responded to Thursday's air strike with a barrage of rockets, some of which landed near Beersheba, a city 35 km (30 miles) from Gaza. No one was hurt. Air-raid sirens summoned residents of southern Israel to shelters.

Another Israeli air strike followed before dawn on Friday, hitting a Hamas training camp in Gaza City.

The blast flattened a nearby home, killing its owner and his 12-year-old son. The man's wife and five other children were wounded, hospital officials said.

In a statement expressing regret for the civilian casualties, the military said Palestinian rockets stored next to the camp had stoked the explosion.

Hamas accused Israel of a massacre.

Palestinian militants stepped up rocket attacks as night fell. Three groups said they had fired more than a dozen projectiles across the border. Israel police said at least ten of them landed in Israeli territory, causing no casualties.

Witnesses in Gaza reported heavy activity of Israeli drones over head.

Ismail Haniyeh, head of the Hamas administration in Gaza, told reporters the group was pursuing intensive contacts with several Arab and international parties, and we stress the necessity of this aggression being stopped immediately.

Hamas spurns peacemaking with the Jewish state but has in the past proposed truces as it sought to consolidate control over Gaza and negotiate power-sharing with the rival, U.S.-backed Fatah faction of Palestinian President Mahmoud Abbas.

TIES THAT BIND

Instability has spread in Sinai as Cairo struggles to restore order after the fall of Hosni Mubarak in February.

Armed infiltrators killed eight Israelis on the border with Sinai in August. Israeli troops repelling the gunmen killed five Egyptian police, triggering outrage in Cairo that spilled over into the mobbing of Israel's embassy a month later.

Israel apologised for the Egyptian deaths and Egypt's interim military rulers vowed to mount security sweeps of Sinai.

Hamas's standing has grown with the political rise of the kindred Egyptian Muslim Brotherhood, formerly a suppressed though popular opposition group. Israel worries about the prospects for its landmark 1979 peace accord with Egypt, which secured the demilitarisation of the Sinai.

The State of Israel is in a bind, defence analyst Alex Fishman wrote in the biggest-selling Israeli newspaper Yedioth Ahronoth. It can't operate in Sinai in order to defend its sovereignty for fear of its relations with Egypt ... and because it can't beat the donkey, it beats the saddle -- and Gaza suffers the blows.

Some of the Palestinian rockets fired on Thursday and Friday were claimed by a Fatah-linked militia that lost one of its leaders, Essam Al-Batsh, in Israel's air strike.

Israel said he had also been involved in a 2007 suicide bombing that killed three people in Eilat, a Red Sea port abutting Egypt. The Eilat area went on security alert this week, with the military citing fear of infiltration from Sinai.

Hamas had no comment on the rockets. It has kept out of some of the recent fighting in Gaza, much of which has been between Israel and Islamic Jihad, a different Palestinian armed faction.

The chief of Israel's military, Lieutenant-General Benny Gantz, told parliament last month a new Israeli offensive in Gaza could be drawing close because of the rocket threat.

That stirred speculation that Israel, which launched a devastating war on Hamas in 2008-2009, might mobilise for a similar assault ahead of the possible installation of a new Islamist-led government in Egypt.

Giora Eiland, a former Israeli national security adviser, warned that could backfire by providing an electoral boost to the Muslim Brotherhood and Egypt's ultra-conservative Salafis.

An operation in Gaza is liable to play into their hands, with a kind of acceleration of political processes that you don't want, Eiland told Israel Radio.

(Writing by Dan Williams; Additional reporting by Ari Rabinovitch and Maayan Lubell; Editing by Maria Golovnina)