Israel and Hamas agreed to an Egyptian proposal for a new 72-hour ceasefire on Sunday night in a last-ditch attempt to avert a lengthy war in Gaza.

Though most people in the coastal enclave welcomed the prospect of relief from the conflict, few expressed much optimism that any new pause – the eighth attempt at ending the fighting – would last.

The ceasefire was due to come into effect from midnight local time. It would allow talks on a more comprehensive agreement.

Israeli officials said a delegation would travel to Cairo, where the indirect talks have been held, if the ceasefire held.

One of Hamas's negotiators in Cairo said negotiations would resume at 10am on Monday.

"The Egyptian mediators have informed us that the Israelis will take the process seriously," he said.

Hamas had refused to extend the last truce, saying Israel had failed to respond to any of the demands Palestinian negotiators made in indirect talks in Cairo, and there has been continuous rocket and mortar fire into Israel from Gaza since. Two Israelis have been injured.

At least 15 people in Gaza have been killed by Israeli air strikes since the last ceasefire ended on Friday.

There were intense air strikes in Gaza in the hours before the ceasefire, with a factory in central Gaza City hit and homes in the northern town of Beit Lahiya. Israeli officials said medium-range rockets had been fired at Israel for the first time for several days during the evening.

Analysts hope the new ceasefire will avert a long and lethal period of continued violence in Gaza punctuated by intermittent truces which would exacerbate a grave humanitarian crisis and curtail any attempts to repair the enormous damage done to Gaza's infrastructure in the month-long conflict.

"The Egyptians are trying to broker something, but if it fails we are going to see a long war of attrition or even a much harder way of fighting," said Mkhaimar Abusada, a Gaza-based political analyst.

Around 500,000 people in Gaza have been forced out of their homes, with more than 200,000 living in UN schools. Roads, the water supply, sanitation systems and power generation and distribution networks have all been badly damaged. At least 60,000 people are homeless.

Ten out of 26 hospitals, comprising 40% of beds in Gaza, have been shut, officials said.

A three-day pause is unlikely to convince many of those displaced in the conflict to return home.

"I can't go home unless there is a real peace," said Joma'a Ahmed Zaid, a farmer and fisherman from north-west Gaza. "My home is badly broken and my fields are ruined. I need much time and much help to repair everything."

Zaid was one of nearly 2,000 people staying in one UN school in Gaza City. The last ceasefire convinced half to head home, but all returned to the school when hostilities resumed.

Amad Zaqqout, the deputy director of the school and now head administrator of the shelter, said that her staff were exhausted. One colleague slept in a corner of her office as she spoke.

"I feel like we can't go on. But we will have to," she said.

In one classroom, now home to more than 40 members of an extended family, women were stunned by the possibility that the conflict could continue for many weeks. The family have no electricity, and share a single set of latrines with hundreds of others.

"It is just impossible to imagine. It is a catastrophe. The kids are all sick and bored and angry. We have no work and little food. I am eight months pregnant. How can this last any longer? Where will I have my baby?," said Hiam Joma'a' Zaid, 34.

More than 1,900 Palestinians, mostly civilians, have died in the most deadly round of fighting between Israel and Hamas since the group seized control of Gaza in 2007, a year after winning a surprise victory in Palestinian elections. Three civilians in Israel have been killed and 64 soldiers.

More than 3,000 rockets have targeted Israel since tensions rose in June.

Ihab al-Ghussein, a Hamas spokesman in Gaza, said the group wanted "a firm commitment for real negotiation" before agreeing to any ceasefire.

Speaking before news of the latest agreement broke, he said if hostilities continued "the resistance factions will judge what measures to take, what to shoot and who will shoot it."

He said: "There are other means beyond rockets too. This is the speciality of [Hamas's military wing] and they have initiatives they can take."

Abu Sada said: "Hamas is not going to defeat Israel. Israel is not interested in reoccupying Gaza which would cost a lot of casualties. So both sides will try to exhaust each other. But this will be a disaster for Palestinians."

Saeed al-Saoudi, the head of civil defence in Gaza, said the continuing hostilities were causing problems for teams trying to clear rubble, retrieve the remains of casualties from ongoing strikes and restore basic services.

"Three of our eight ambulances have been destroyed and two fire trucks. We have no ladders, no search equipment and have had 36 people killed from my department," al-Saoudi said.

Crucial material needed for reconstruction cannot enter Gaza until hostilities end. The import of cement and other materials is a particularly contentious issue as Israel believes Hamas will use it to build cross-border tunnels which threaten its security. Israeli troops destroyed more than 30 tunnels during the bloodiest phase of the conflict.

Yesterday Israel said the border crossing at Kerem Shalom had to be shut due to mortar fire from within Gaza, holding up the entry of humanitarian supplies.

Weeks of further conflict is likely to see tensions rise elsewhere. In the restive West Bank, which has seen large demonstrations in recent weeks, an 11-year-old Palestinian boy was shot dead by Israeli troops in a refugee camp.

Hamas has repeatedly complained that throughout negotiations – conducted via Egyptian intermediaries – Israel has never formally responded to any Palestinian demands, which centre on ending the eight-year blockade of the Gaza Strip.

The concession Hamas most wanted from Israel, Marzouk said, was the right to build a port and airport in Gaza, facilities promised to the Palestinians under the Oslo peace deal.

In return, he said Hamas had no problem with relinquishing power to a Palestinian Authority-led unity government that "should control everything in Gaza", including its border crossings.

A deal establishing a "unity government" was signed in June.

However Hamas officials have repeatedly said that disarmament was "out of the question".

Muammar Ayyad, 19, who has lost 18 members of his family in this conflict, said that Hamas was right to reject any deal which did not end the blockade. "Without lifting the siege, I do not welcome any ceasefire, even if all my family end up killed," he said.

On Sunday, Binyamin Netanyahu, the Israeli prime minister, said that Israel would not negotiate "under fire" and promised that the current military operation would continue until its citizens could enjoy "peace and security".