Israel said Tuesday it was withdrawing all ground forces from the Gaza Strip at the start of an Egyptian-brokered 72-hour ceasefire intended to bring to a halt the nearly month-long war after multiple broken truces.

The cease-fire, which took effect at 8 a.m. Tuesday, was agreed to late Monday night by both Israel and Hamas following talks in Cairo. It closely resembles previous proposals for an unconditional pause in a conflict that has left nearly 2,000 people dead — the overwhelming majority of them Palestinians.

Israel did not send representatives to the Cairo talks, but Israel Defense Forces spokesman Lt. Col. Peter Lerner said Israel would abide by the truce’s terms, and would have all ground forces withdrawn from Gaza by 8 a.m. Lerner said Israel “would continue to maintain defensive positions from the air, from the coast and from the ground, but outside the Gaza Strip.”

Ezzat Al Reshek, a Hamas representative at the Cairo talks, said that the group would abide by the cease-fire and that it is ready to begin indirect negotiations in the Egyptian capital about the terms for a lasting truce.

The cease-fire deal comes at a time when Israel and Hamas appear to be curtailing their attacks. Hamas rocket fire has diminished in recent days, and Israel had already pulled most of its ground troops from Gaza on Sunday.

Nonetheless, the agreement is extremely delicate, with both sides accusing the other of frequent violations of truce terms during four weeks of failed efforts to stop the violence.

Lerner said Hamas still has thousands of rockets, even after firing more than 3,300 into Israel. A further 3,000 are believed to have been destroyed in Israeli military operations that included 4,800 strikes on Gaza.

Lerner said that Israel had destroyed all known tunnels between Israel and Gaza — 32 in all.

Even as fighting in Gaza slowed Sunday, new flash points emerged beyond the territory’s boundaries, with a pair of attacks on Israelis along the line separating East and West Jerusalem.

The assaults — one with a gun, the other with a backhoe — set this bitterly contested city on edge Monday, prompting Israeli police armed with automatic weapons to set up makeshift checkpoints. Ambulance services went on high alert.

Security officials said they think the attacks were a response to the conflict in Gaza, where sporadic violence continued Monday despite Israel’s unilateral declaration of a
seven-hour pause in the fight.

Just minutes after the cease-fire was set to begin Monday morning, Israel fired two missiles at a multi-story house in the Shati refugee camp in northern Gaza, killing at least three people, including an 8-year-old girl, according to the Gaza Health Ministry.

The girl’s 1-year-old sister was buried in the debris. Scores of rescuers searched for the baby in the remains of the collapsed building, using a jackhammer and their bare hands to remove toppled bricks. Eight hours later, the men were still digging, but even the baby’s family had lost hope.

“She’s under so much rubble,” said her uncle, Zaki al-Bakri. “Only Allah can help us now.”

The attack prompted Hamas to accuse Israel of deceit — a familiar refrain from both sides in a conflict that has proved to be a graveyard for truces during weeks of unrelenting bloodshed. Palestinian officials say the conflict has killed at least 1,865 people, including hundreds of women and children. Sixty-seven Israelis have died, most of them soldiers.

For the first time since the war began, deadly violence struck Jerusalem on Monday when an Arab construction worker used his backhoe to run down an Israel civilian and then topple an empty bus. The civilian was killed and three other people were hurt, including the bus driver, said police spokesman Micky Rosenfeld. Police fatally shot the construction worker, who was identified as an East Jerusalem resident in his 20s.

Hamas spokesman Fawzi Barhoum described the attack as a “brave resistance action, and a natural reaction to the occupation’s massacre of our people in Gaza.”

The incident provoked rage from residents of the predominantly ultra-Orthodox neighborhood, who cheered and chanted “Death to the Arabs” as the assailant’s body was taken away in an ambulance.

“They’re trying to kill Jews wherever we are all over our country. They’ve lost the war in Gaza, so they’re trying to make war here,” said Shalom Zapor, 55, an emergency worker, as he stood beside the shot-up cab of the backhoe.

He gestured to a neighborhood 100 yards away, past a roadway that until 1967 was the heavily fortified dividing line between Israeli and Jordanian control.

“That’s the problem with this city: We’re so close,” he said. “Just beyond this street are the Arab people. They’re the problem in Jerusalem, and this is only the start.”

Across the road — beyond a phalanx of police who had assembled to ward off further violence — there was fear of reprisals. Tit-for-tat killings of Jewish and Arab teenagers helped trigger the current round of violence, and residents said they worried that the stage had been set for more bloodshed.

“This is the spark of war,” said Fadi Siniora, 24, an Arab resident and chef at a hotel.

Until Monday, Jerusalem had been calm, despite the storm of rocket and missile fire in Gaza and southern Israel. But just three hours after the backhoe attack, a 20-year-old Israeli soldier was shot in the stomach as he waited at a hitchhiker’s stand near the entrance to the Hebrew University of Jerusalem. He was being treated for serious wounds Monday afternoon at Hadassah Medical Center.

Rosenfeld said the assailant, who escaped, had fired from a motorbike. Across the city, police began to stop riders as they made their way between Jerusalem’s mostly Arab east and its largely Jewish west.

Rosenfeld called both incidents “terrorist attacks,” and although police did not think they were connected, security forces went on high alert Monday evening as Jews marked Tisha B’Av, a fasting day that commemorates the destruction of Jerusalem’s First and Second temples.

In Gaza, there was supposed to be a seven-hour pause in Israel’s operations Monday, beginning at 10 a.m. Israel called the unilateral cease-fire after an Israeli airstrike that killed at least 10 people outside a United Nations-run school in southern Gaza received harsh international condemnation. The strike Sunday marked the seventh attack on or near a U.N. school sheltering refugees.

Before Monday’s cease-fire began, one of the most senior militant commanders to be killed in the month-long operation was felled by an Israeli airstrike. The Palestinian Islamic Jihad, a close ally of Hamas, said Daniel Mansour, 44, the leader of its northern flank, died in an attack on his home just before dawn Monday.

The airstrike on the house in the Shati refu­gee camp came after the cease-fire was supposed to have taken effect. Hamas spokesman Sami Abu Zuhri called it “evidence that the occupation is lying and this whole humanitarian truce is just for media propaganda.” Hamas and its allies continued firing rockets toward Israel on Monday, launching at least 31.

Capt. Eytan Buchman, a spokesman for the Israel Defense Forces, acknowledged it was possible that the attack on the house in the Shati camp had occurred after 10 a.m. He did not respond to questions about the why it had been targeted.

The house was in a neighborhood of Gaza where people live close together. Residents said they did not receive a phone call from the Israeli military warning them to evacuate, a procedure Israel has often used during the conflict.

“We were very surprised,” said Bakri, the uncle. “They didn’t warn us. They didn’t call us. Everyone was outside to shop during the cease-fire. It was a miracle more didn’t die.”

Raghavan reported from Gaza City. Orly Halpern in Jerusalem and Islam Abdel Karim in Gaza City contributed to this report.