Palestinians take refuge inside a classroom at a United Nations-run school in Jabaliya refugee camp in the northern Gaza Strip Reuters

Israel and Hamas have agreed to an unconditional three-day humanitarian truce aimed at providing much-needed relief to civilians, beginning Friday morning.

The 72-hour break after more than three weeks of fighting is set to begin at 8am (0500 GMT), according to a joint statement released by US Secretary of State John Kerry and UN Secretary-General Ban Ki-moon.

This crucial peace window is expected to help civilians in Gaza receive urgently needed humanitarian relief and food supplies, besides taking care of the injured and burying the dead.

There are over 200,000 Palestinians living in cramped conditions in 86 shelters across the region.

An official in Prime Minister Benjamin Netanyahu's office said Israel had accepted the US/UN proposal.

Hamas spokesman Osama Hamdan said: "It's not our duty to protect Israel or be a guardian of Israel's security. But, at this time, all of the Palestinian resistance movements have declared and approved the ceasefire for 72 hours, so I think they respect that and [will] be committed to their declaration."

Cairo Talks

Israeli and Palestinian delegations will travel to Cairo for separate negotiations with the government of Egypt to discuss a longer-term solution.

Officials said the talks could start as early as Friday, depending on how long it takes the parties to reach Cairo.

However representatives from Israel and the US will not sit across the table from Hamas, the official added. The US, the European Union and Israel consider Hamas a terrorist group.

According to the truce statement, forces on the ground would remain in place during the ceasefire.

Meanwhile, Palestinian negotiator Saeb Erakat said the delegation sent to Cairo will include "all Palestinian factions" -- not just Hamas.

"I am hoping against hope that we can [make] every possible effort, with the help of everyone out there, [to] reach a permanent ceasefire."

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

Eight Killed

Early on Friday, before the ceasefire took effect, eight Palestinians were killed by Israeli tank fire in the southern Gaza Strip, according to AFP.

The Israel Defence Forces said five soldiers were killed by mortar fire near the Gaza border late on Thursday.

Hours before the ceasefire was announced, Netanyahu insisted that he would not accept any truce that stopped Israel from completing the destruction of militants' infiltration tunnels.

"Until now, we have destroyed dozens of terror tunnels and we are determined to finish this mission - with or without a ceasefire," he said.

Attack on School

An attack on a school in the Jabaliya refugee camp on Wednesday killed at least 16 displaced civilians, while shelling in a market near Gaza City on the same day killed 17 people. These attacks invited strong international condemnation.

The US described the shelling of the school as "totally indefensible" and urged Israel to do more to protect civilian life. Israel said it would investigate the shelling of the school and apologise if Israeli fire was responsible.

UN High Commissioner for Human Rights Navi Pillay has accused both sides of violating the rules of war.

She said Hamas had done so by "locating rockets within schools and hospitals, or even launching these rockets from densely populated areas", while Israel had attacked civilian areas of Gaza such as schools, hospitals, homes and UN facilities.

According to a UN humanitarian aid coordinator, there are now 440,000 refugees fleeing the fighting in Gaza, and hundreds of thousands more were without basic services, power and food.

More than 219,000 Palestinians are packed into 86 shelters across Gaza, the UN said.

Clean water is inaccessible for most. And some 3,600 people have lost their homes.

"We cannot supply electricity for hospitals, sewage treatment or domestic use," said Fathi al-Sheikh Khalil, deputy chairman of the Palestinian Energy Natural Resources Authority in Gaza. "This is a disaster."

A Gaza health spokesman said health care workers are struggling to deal with the numbers of dead and wounded.

Gaza officials say at least 1,427 Palestinians, most of them civilians, have been killed in the battered territory and nearly 7,000 wounded.

On the Israeli side, 56 soldiers have been killed in the fighting and more than 400 wounded.