It was the start of a three-day truce, the best hope yet to end a 25-day-old war that has taken an enormous toll on both Palestinians and Israelis.

On Friday morning, Israeli troops were in the southern Gaza Strip preparing to destroy a Hamas tunnel, said Israeli military officials. Suddenly, Palestinian militants emerged from a shaft. They included a suicide bomber, who detonated his explosive device. In the chaos, two Israeli soldiers were killed. The militants grabbed 2nd Lt. Hadar Goldin, 23, and pushed him back through the tunnel, according to the Israeli account.

Within minutes, the war was back.

“The cease-fire is over,” declared Lt. Col. Peter Lerner, a senior spokesman for the Israel Defense Forces. Ground operations will continue, he said, “and our aircraft are in the sky as we speak.”

By Friday afternoon, Israel was heavily shelling areas near the border city of Rafah, where the soldier’s capture occurred. Hamas officials were disputing the timeline of the clashes, accusing Israel of breaking the cease-fire. And the United States and the United Nations, the architects of the truce, were condemning the killing of the two soldiers and Goldin’s abduction while seeking ways to save the peace talks scheduled to take place in Cairo over the weekend.

Goldin’s fate, military analysts said, could alter the course of the conflict, with Israel either slowing its offensive to negotiate his return or widening its operations, pushing deeper into the Gaza Strip to eradicate Hamas, and leading to the likelihood of greater civilian casualties.

Israel’s bombardment Friday in the Rafah area killed 52 Palestinians and injured more than 350, said Gaza Health Ministry officials, bringing the Palestinian death toll to more than 1,600 since the conflict began July 8. Sixty-three Israeli soldiers have been killed and more than 400 wounded. Three civilians have been killed by mortar rounds or rockets fired by militants from Gaza into Israel.

President Obama, speaking in the White House briefing room, urged Hamas and other Palestinian factions to release Goldin, saying that was an essential condition for a durable truce. He added that Israel had “a right to defend itself.”

“I think it’s going to be very hard to put a cease-fire together again if Israel and the international community can’t feel confident that Hamas can follow through,” Obama said. “When they sign on a cease-fire they’re claiming to speak for all Palestinian factions. . . . If they don’t have control of them . . . then it’s hard for the Israelis to feel confident that a cease-fire can actually be honored.”

Israel said the capture took place an hour and a half after the truce began Friday morning. It said the officer was taken in the no man’s land in the seaside enclave, east of Rafah. Hamas officials said the clashes­ occurred before the truce began. But there was no immediate acknowledgment that the Palestinian militants, who seized Gaza in 2007, were holding Goldin.

In a statement early Saturday morning, the military wing of Hamas denied abducting Goldin and suggested that he may have been killed in the fighting.

Both sides accused each other on Friday of breaking the cease-fire. Sami Abu Zuhri, a Hamas spokesman, declared that Israel was misleading the world to justify “its violation of the truce and to cover up their savage massacres in Rafah.”

Israeli Prime Minister Benjamin Netanyahu told Secretary of State John F. Kerry in a telephone call Friday afternoon that the cease-fire was broken by Hamas and that the Islamist group and other Palestinian militant factions “will bear the consequences of their actions,” according to Netanyahu’s office.

In a statement issued after his phone conversation with Netanyahu, Kerry reproached Hamas for breaking assurances given to the United States and the United Nations. He called on Hamas to release the captive immediately and unconditionally. “It would be a tragedy if this outrageous attack leads to more suffering and loss of life on both sides of this conflict,” he said.

While Qatar and Turkey played a role in confirming Hamas’s agreement to honor a cease-fire, the United Nations also had “assurances we had received directly” from the Hamas leadership, U.N. Undersecretary Jeffrey Feltman said Friday.

Saying that the United Nations was “profoundly disappointed” that the lull in fighting “seems to have lasted for maybe 90 minutes this morning,” Feltman described it as a “tragic loss of opportunity for both sides.”

The 72-hour cease-fire had been designed not only to allow humanitarian relief for both sides but also to pave the way for a durable truce through the discussion of demands from both sides in Cairo.

“I hope we can get back to that,” Feltman said. “But it’s going to be extremely difficult in the situation that we see in the Gaza Strip now, particularly with the captured Israeli soldier.”

On Friday morning, after the truce began at 8 a.m. local time, Gazans emerged from their homes to shop or visit families. Others went back to their neighborhoods to assess the damage to their houses, retrieve belongings and bury their dead. Fishermen jumped into their boats and headed to sea while children played on the beach and frolicked in the waves.

By midday, as the news spread of the collapse of the truce, they fled back to their homes and the streets were once again empty.

Israeli analysts said Netanyahu and his top advisers will have to consider expanding the operation in Gaza — even if that was not their original intent.

“It puts the cabinet in a very awkward position,” said Meir Elran, a former deputy director of military intelligence and current researcher at the Institute for National Security Studies in Tel Aviv. “So far the idea was to do away with the tunnels and extract ourselves from Gaza. But there are a lot of calls within Israel to expand the pressure.”

Elran said that could take the form of a much more aggressive ground operation, which he described as “very, very limited” until now.

Shaul Shay, a former deputy head of Israel’s National Security Council, said Goldin’s abduction represented a major success for Hamas, becoming a source of leverage, both in crafting a truce and negotiating an exchange for the release of Hamas members held in Israeli jails.

“From their point of view, it’s a significant achievement — maybe their most significant achievement in this conflict,” said Shay, a senior research fellow at the Begin-Sadat Center for Strategic Studies.

He said that rescuing Goldin will inevitably force Israel to shift its focus and direct energies toward finding the missing soldier, prolonging a war that has already stretched longer than Israel’s two other major conflicts in Gaza against Hamas, in 2008-2009 and 2012.

There’s little guarantee, though, that Goldin can be found and brought out alive. “It’s not a simple task. We’ve seen how they use tunnels, and it’s a built-up area,” Shay said.

“This morning we had a 72-hour cease-fire,” he added. “Now we’re in a situation where Israel has to continue its operation until this soldier is found.”

Booth and Witte reported from Jerusalem. Karen DeYoung in Washington, Ruth Eglash in Jerusalem and Islam Abdel Karim in Gaza City contributed to this report.