CAIRO — Israel and the Hamas militant group accepted an Egyptian cease-fire proposal Sunday, clearing the way for the resumption of talks on a long-term truce to end a month of heavy fighting in the Gaza Strip that has taken nearly 2,000 lives.

The announcement marked the second time in less than a week that the bitter enemies had agreed to Egyptian mediation. A similar three-day truce last week collapsed in renewed violence over the weekend.

The truce took effect at midnight, preceded by heavy rocket fire toward Israel. In Cairo, the Egyptian Foreign Ministry said the cease-fire would allow humanitarian aid into battered Gaza neighborhoods and the reopening of indirect talks on a more lasting and comprehensive deal.

Hamas is seeking an end to the Israeli-Egyptian blockade against Gaza, while Israel wants Hamas to dismantle its arsenal of rockets and other weapons.

Palestinian negotiators accepted the proposal early Sunday after meeting with Egyptian officials throughout the weekend. Israeli officials concurred later. Both delegations are back in Cairo.

Qais Abdelkarim, a member of the Palestinian delegation, said indirect talks with the Israelis would begin Monday “with the hope of reaching a lasting cease-fire.” The goal, he added, was to end the blockade, which he called “the reason for the war.”

More than 1,900 Palestinians have been killed, including hundreds of civilians. On the Israeli side, 67 people have been killed, including three civilians.

The fighting ended in a three-day cease-fire last Tuesday. Egypt had hoped to use that truce to mediate a long-term deal. But when it expired, militants resumed their rocket fire, sparking Israeli reprisals.

The Israeli military reported some 30 rocket attacks from Gaza on Sunday. Palestinian medical officials said seven people were killed in Israeli airstrikes, including the bodyguard of a Hamas leader.

Israel had walked away from cease-fire talks over the weekend. “Israel will not negotiate under fire,” Prime Minister Benjamin Netanyahu said earlier Sunday, warning that his country’s military campaign “will take time.”

Last week’s talks failed in part because Israel rejected Hamas’ demand for a complete end to the blockade. Israel says the closure is necessary to prevent arms smuggling, and officials do not want to make any concessions that would allow Hamas to declare victory.

A senior Palestinian negotiator acknowledged that the Palestinians would make more modest demands this time around. He said they will seek an end to the bloodshed in Gaza and an easing – but not an end – to the blockade.

“We might not get everything we want, particularly on freedom of movement. But we believe the Israelis and the world have gotten the point that Gazans should live normally and things should be much better than today,” the negotiator said, speaking on condition of anonymity because he was discussing internal Palestinian deliberations.