A Gaza ceasefire crumbled only hours after it began on Friday, with at least 40 Palestinians killed by Israeli shelling and Israel accusing militants of violating the US- and UN-brokered truce by firing rockets and mortars.

The 72-hour break announced by US Secretary of State John Kerry and UN Secretary-General Ban Ki-moonwas the most ambitious attempt so far to end more than three weeks of fighting, and followed mounting international alarm over a rising Palestinian civilian death toll.

The ceasefire was to be followed by Israeli-Palestinian negotiations in Cairo on a longer-term solution.

Israel launched its offensive in Hamas Islamist-dominated Gaza on July 8, unleashing air and naval bombardments in response to a surge of cross-border rocket attacks. Tanks and infantry pushed into the territory of 1.8 million on July 17.

Gaza officials say at least 1,499 Palestinians, mostly civilians, have been killed and 7,000 wounded. Sixty-one Israeli soldiers have been killed and more than 400 hurt. Three civilians have been killed by Palestinian rockets in Israel.

Some two hours after the truce went into effect, Israeli tanks and artillery opened fire in the southern Rafah area, and a local hospital said 40 people were killed.

The Israeli military had no immediate comment but media reports said the shelling began after Hamas fighters exchanged fire with Israeli soldiers on a mission to destroy infiltration tunnels.

Eight rockets and mortar bombs were fired from Gaza at Israel, the military said, adding that one was intercepted by the Iron Dome system and seven hit open areas.

An official in Israeli Prime Minister Benjamin Netanyahu's office said Hamas and other armed groups in the Gaza Strip had "flagrantly violated the ceasefire". But the official stopped short of formally declaring the truce over.

After the ceasefire began at 8am (5am GMT), Gaza's streets began to fill with Palestinian families. Laden with belongings, they streamed back to homes they fled during fierce fighting that destroyed or damaged thousands of dwellings.

"We are going back to Beit Lahiya (in the northern Gaza Strip)," said Asharaf Zayed, a 38-year-old father of four. "We hope the truce will be permanent and we won't have to go back to a UN shelter."

Amid strong public support in Israel for the Gaza campaign, Netanyahu had faced intense pressure from abroad to stand his forces down.

International calls for an end to the bloodshed intensified after shelling on Wednesday that killed 15 people sheltering in a UN-run school in Gaza's Jabalya refugee camp.

The truce left Israeli ground forces in place in the Gaza Strip and a military spokeswoman said operations were continuing to destroy a warren of tunnels through which Hamas has menaced Israel's southern towns and army bases.

"We are doing what needs to be done in order to neutralise them," she said.

Accomplishing that mission - the military said on Thursday the tunnels hunt could be wrapped up in a few days - could open the way for Israel to declare it has achieved the main goal of the ground assault and withdraw its soldiers from Gaza.

"Our understanding is that the Israelis will make clear to the UN where their lines are, roughly, and they will continue to do operations to destroy tunnels that pose a threat to Israeli territory that lead from the Gaza strip intoIsrael proper as long as those tunnels exist on the Israel side of their lines," a US State Department official said.

Hamas, isolated in an Arab world concerned about the rise Islamist militancy, is seeking an end to Israel's blockade of Gaza. It also wants a hostile Egypt to ease restrictions at its Rafah crossing with the territory imposed after the military toppled Islamist president Mohamed Mursi last July.

Israel has balked at freeing up Gaza's borders under any de-escalation deal unless Hamas's disarmament is also guaranteed.

A senior State Department official travelling with Kerry in India said US Deputy Secretary of State Bill Burnswould arrive in Cairo on Saturday and that Frank Lowenstein, the acting US envoy for Middle East peace, and another US official, Jonathan Schwartz, would be there on Friday.

The official said he believed the Palestinians would be in Cairo on Friday, while the Israelis would arrive on Saturday.

The Palestinian delegation will be comprised of Hamas, Western-backed Fatah, the Islamic Jihad militant group and a number of smaller factions, Palestinian officials said.

But U.S. officials said Israel and the United States would not sit across the table from Hamas, which the two countries, along with the European Union, consider a terrorist group.

Just over an hour before the ceasefire was due to take effect militants fired 11 rockets into Israel, one of which was intercepted by the Iron Dome defence system over the centre of the country, a military spokeswoman said.

Israeli strikes killed 14 people in Gaza, including eight from one family, hospital officials said. Earlier, Hamasrockets set off sirens in the Tel Aviv area and one was intercepted.

Israel's military said five of its soldiers were killed late on Thursday by a mortar bomb.

Previous international attempts to broker a humanitarian truce secured only shorter periods of calm, with some collapsing immediately after being announced.