Yousef Al-Helou, Mohammad Awad and Sarah Lynch

Special for USA TODAY

GAZA CITY — Gaza residents took to the streets in celebration Tuesday as Israel and Hamas agreed to an Egyptian-brokered, open-ended cease-fire, ending seven weeks of conflict that killed more than 2,200 people, mainly Palestinians.

"Finally, we will have some time to breathe and inspect the huge damage done to our homes and properties," said Nidal Hararah, 60, a grandfather in Gaza City. "Thank God that my family is alive. ... We will rebuild what was destroyed. We will defy our fears and fight for a better future."

Violence persisted up until the truce's start at 7 p.m. (noon ET). Mortar shells from Gaza killed one man and seriously wounded two others in Israel as an Israeli airstrike caused a seven-story building in Beit Lahiya to collapse.

The cease-fire includes an agreement to open border crossings between Gaza and Israel to allow the flow of humanitarian relief, assistance and materials for reconstruction in Gaza, Egyptian Foreign Ministry spokesman Badr Abdelatty said.

"The two sides will abide by the cease-fire without a time limit," he said, citing "extensive, continuous efforts" over the past two weeks to achieve the agreement.

Palestinians will be allowed to fish in an area up to 6 miles off the Gaza coast into the Mediterranean, up from 3 miles, Abdelatty said.

"The deal includes as well the continuation of indirect talks between the two sides here in Egypt to tackle other areas of mutual interest and concerns," he said. Those talks will begin within a month and include issues such as building a seaport and airport in Gaza and Israel's demand that Hamas disarm.

Despite the signs of progress, it remains to be seen whether the cease-fire will hold where others have failed.

Mahmoud Zahar, a senior leader of Hamas, the militant group that controls Gaza, promised to rebuild homes destroyed in the fighting and said Hamas would rearm.

"We will build and upgrade our arsenal to be ready for the coming battle, the battle of full liberation," he said, surrounded by Hamas gunmen.

In Israel, government spokesman Mark Regev said, "This time, we hope the cease-fire will stick." He portrayed the deal as one Hamas had rejected in previous rounds of negotiations.

In Washington, State Department spokeswoman Jen Psaki said the agreement offers "an opportunity, not a certainty."

"Today's agreement comes after many hours and days of negotiations and discussions. But certainly there's a long road ahead. … We're going into this eyes wide open," she said.

United Nations Secretary-general Ban Ki Moon welcomed the cease-fire but warned that "any peace effort that does not tackle the root causes of the crisis will do little more than set the stage for the next cycle of violence."

The terms of the cease-fire are similar to those that ended more than a week of fighting with Israel in 2012. Under those terms, Israel promised to ease restrictions gradually, while Hamas pledged to halt rocket fire from Gaza. The truce held for long stretches, but Gaza's border blockade remained largely intact and intermittent rocket fire from Gaza continued.

Israel and Egypt imposed the blockade restricting freedom of movement and trade after Hamas came to power in Gaza in 2007. Only a few thousand of Gaza's 1.8 million people are able to leave the coastal territory every month.

While many celebrated the breakthrough, some Israelis said they didn't see a bright future, considering the number of times the two sides have relapsed into conflict. Thousands of Israelis fled their homes in recent days when Hamas escalated mortar fire from Gaza.

"In recent years, we've been having these kinds of attacks on average every two years," said Maya Naveh, 35, of Modiin, an Israeli city bordering the West Bank. "The area is like dry thistles — you just need to throw a match, and everything is ablaze. So I am not very optimistic about the future."

The truce follows Israeli airstrikes in recent days that have targeted high-rise buildings, hitting six towers and shopping complexes since Saturday.

Israel began its Gaza offensive in response to Hamas rocket fire and to neutralize a tunnel system it said was used to carry out attacks on its territories. During cease-fire negotiations, Israel demanded that Hamas disarm and end the rocket-fire, but Hamas said it would do so only if the blockade was lifted.

Despite not receiving exactly what it asked for, Hamas declared the truce a victory.

"We are here today to declare the victory of the resistance, the victory of Gaza with the help of God and the steadfastness of our people and the noble resistance," Hamas spokesman Sami Abu Zuhri said in a news conference at Gaza's Shifa Hospital.

Since July 8, Israeli airstrikes have destroyed or severely damaged more than 17,000 Gaza homes, leaving about 100,000 homeless, according to the United Nations. At least 2,140 Palestinians have died in the fighting, according to the Gaza Health Ministry. In Israel, 69 were killed, including 64 soldiers, according to the Israeli military.

Israel launched 5,000 airstrikes at Gaza, while Gaza militants fired close to 4,000 rockets and mortars, according to the Israeli military.

Lynch reported from Cairo. Al-Helou reported from London. Contributing: Victor Kotsev in Istanbul, Jennifer Collins in Berlin and the Associated Press