Israel and Hamas agreed to a cease-fire Thursday, halting a bruising 11-day war that caused widespread destruction in the Gaza Strip, brought life in much of Israel to a standstill and left more than 200 people dead.

A statement put out by the Israeli prime minister’s office said the security cabinet had “unanimously” agreed to accept an Egyptian proposal for a “mutual cease-fire,” but did not specify when it would start.

“The political leadership emphasizes that it is the reality on the ground that will determine the future of the operation,” the statement said.

An hour after the Israeli government’s announcement, Taher Al-Nono, the political adviser to the head of the political bureau of Hamas, issued a statement saying they had agreed to a cease-fire to start at 2 a.m. local time on Friday (7 p.m. EDT), as long as Israel abides by the same conditions.

The spokesman for the Qassam Brigades, the military wing of Hamas, said that if Israel launched an attack on Gaza before 2 a.m., the militant group was prepared to continue launching rockets.

The truce appeared to be holding several hours after it began.

United States President Joe Biden spoke Thursday evening from the White House after the announcement of the cease-fire. He said Israelis and Palestinians “equally have the right to live safely and securely and to enjoy equal measures of freedom, prosperity and democracy.”

“My administration will continue its quiet and relentless diplomacy toward that end,” Mr. Biden said. “I believe we have a genuine opportunity to make progress and I am committed to working toward it.”

Mr. Biden said the U.S. will continue to support Israel’s Iron Dome missile defense system, which has blocked thousands of rockets during the conflict.