GAZA/SDEROT, Israel (Reuters) - Israel and Hamas, the Islamist group that rules the Gaza Strip, agreed on a truce on Thursday, two Palestinian officials said, an understanding that would end an escalation in fighting that has drawn mutual threats of war.

There was no formal comment from Israel, but an Israeli official who spoke on condition of anonymity denied a cease-fire had been reached. Israel rarely acknowledges reaching any such agreement with Hamas, a group it designates as a terrorist organization and with which it has fought three wars in the past decade.

A surge in cross-border rockets and air strikes in recent weeks have prompted the United Nations and Egypt to try to broker a truce to prevent another all-out conflict.

On Wednesday night and Thursday, Israeli aircraft struck more than 150 targets in Gaza and Palestinian militants fired scores of rockets including a long-range missile deep into Israel, escalating fighting despite the ongoing truce talks.

“Egyptian efforts managed to restore calm between Palestinian factions and Israel that will end the current escalation,” a Palestinian official, who also spoke on condition of anonymity, said. “Palestinian factions will respect calm as long as Israel does,” he told Reuters.

A second Palestinian official with knowledge of the talks said the cease-fire would begin at 2045 GMT.

Abu Mujahed, spokesman for the Popular Resistance Committee, a smaller faction in Gaza, said on his Facebook page: “Upon Egyptian and international efforts, a ceasefire between Palestinian resistance began conditional on the commitment of the occupation.”

Hours earlier, after the long-range Palestinian missile attack - the first of its kind since a 2014 war, Israeli air strikes had resumed after a short lull, flattening a multi-storey building that the Israeli military described as a Hamas headquarters.

A pregnant Palestinian woman and her 18-month-old child were killed in the Israeli attacks overnight on Wednesday, as was a Hamas militant, Gaza medical officials said. Hundreds of people took part in the funeral for the woman and child.

Slideshow ( 25 images )

The Israeli military said seven people were wounded by Palestinian rockets and mortars that hit southern Israel.

Ambulance sirens echoed through the night in Gaza, where families huddled at home as powerful explosions thundered through the strip. Across the border rocket warning sirens sounded almost non-stop from sunset on Wednesday in Israeli towns and villages where residents sheltered in bunkers.

The Israeli military said its aircraft had struck more than 150 Hamas targets overnight, while more than 180 Palestinian rockets and mortars hit southern Israel.

Twenty-five miles from the border, air raid sirens sounded in Israel’s main southern city, Beersheba.

Israeli Army Radio said Palestinian militants had fired a Grad missile capable of reaching Israel’s heartland. Police said they found its remnants in an open area on the outskirts of the city of 200,000 people and that no one was hurt.

Israel responded by hitting the multi-storey building, first with small bombs apparently so that people would evacuate, then flattening it with a huge blast that shook the city and raised clouds of dust and smoke.

Residents said the building had served mainly as a cultural center. Local health officials said 18 bystanders were wounded by the blast. Hamas denied using the facility.

Israeli Prime Minister Benjamin Netanyahu convened his security cabinet late into the night on Thursday. A statement issued by his office before reports a truce had been reached said the forum instructed the military to “keep acting with force against the terrorists”.

Slideshow ( 25 images )

The U.S. State Department condemned the launching of missile attacks into Israel.

“We’ve seen reports that 180 or so rocket attacks have taken place, shot from Gaza into Israel, and we fully support Israel’s right to defend itself and to take actions to prevent provocations of that nature,” State Department spokeswoman Heather Nauert said.

“DEVASTATING CONSEQUENCES”

Egypt and the United Nations have been trying to mediate a comprehensive cease-fire to prevent an escalation in fighting and to ease the deep economic hardship in Gaza, a narrow strip of land that is home to 2 million Palestinians.

Israel captured Gaza in the 1967 Middle East war but withdrew in 2005, while holding onto most of the separate West Bank, where Palestinians have limited self-rule.

For more than a decade Gaza has been controlled by Hamas under an Israeli-Egyptian blockade that has collapsed its economy, creating what the World Bank has described as a humanitarian crisis with shortages of water, electricity and medicine.

Israel says it has no choice but to enforce its blockade to defend itself against Hamas, which calls for Israel’s destruction and has used Gaza as a base for missile attacks.

Yuval Steinitz, a member of Netanyahu’s security cabinet, told Israel Radio earlier that Israel was “not eager for war” but would make no concessions to Hamas.

U.N. Middle East envoy Nickolay Mladenov said the United Nations had engaged with Egypt in an “unprecedented effort” to avoid serious conflict, but “the situation can rapidly deteriorate with devastating consequences for all people”.