Jerusalem CNN  — 

Israel and Hamas reached a ceasefire agreement late Thursday, ending more than 24 hours of hostilities, according to a diplomatic source with knowledge of the negotiations. It was expected to go into effect at midnight local time.

The agreement was backed by Egypt and the United Nations Special Coordinator for the Middle East Peace Process, which led efforts to negotiate the agreement. Both have repeatedly called for the restoration of a ceasefire between Israel and Hamas in previous months.

An Israeli official denied the existence of a ceasefire. Israel has not commented in other recent escalations about the existence of any agreements with Hamas. And as of late Thursday night, Hamas had not issued any statement about a ceasefire.

Israel had launched scores of airstrikes on Gaza over the past day, as Hamas militants fired rockets and mortars into its territory, prompting warnings over the risks of escalation amid efforts to achieve a long-term ceasefire agreement.

The fighting, which began Wednesday, left three Palestinians dead in Gaza, including a pregnant mother and her young daughter, according to the Palestinian Ministry of Health, with injuries reported in Israel and Gaza.

According to the Israel Defense Forces, more than 180 rockets and mortars were launched from Gaza toward Israel, with rocket alarms ringing into the early hours of the morning. Forty rockets were intercepted by Israel’s Iron Dome aerial defense system, while most others landed in open fields in southern Israel.

Several others landed in populated areas, injuring seven, according to IDF spokesman Lt. Col. Jonathan Conricus.

Smoke rises after an Israeli airstrike on Gaza City.

After the rocket launches, the Israeli air force struck more than 150 military targets across 20 sites in Gaza, including manufacturing facilities, weapons depots, training complexes, a maritime tunnel shaft and other sites, according to the IDF.

The Palestinian Ministry of Health identified those killed as 34-year-old Ali Ghandour, 23-year-old Inas Khamash and her 18-month-old daughter, Bayan Khamash. Twelve others were injured, the ministry said.

There was a brief lull in the hostilities Thursday afternoon, but by the evening, the two sides were exchanging fire again.

A series of Israeli airstrikes destroyed the Al Mashal cultural center near Gaza City, according to CNN producers in Gaza. The IDF said the building was used by Hamas’ interior security forces.

Eighteen Gazans were wounded in the strike, according to the Palestinian Ministry of Health.

“Hamas absorbed a powerful blow,” an Israeli official said earlier in the afternoon. “Israel will continue to operate forcefully.”

The strikes came after a rocket fired from Gaza landed near Beer Sheva, a major city in southern Israel about 50 kilometers east of Gaza.

It was the first rocket since the 2014 war to land near Beer Sheva, which is far outside the Gaza periphery, indicating a more powerful rocket was likely used.

Israeli Prime Minister Benjamin Netanyahu and Defense Minister Avigdor Liberman have ordered the Israeli military to be ready for any possibilities.

Escalation risk

Warning of the imminent dangers of continued escalation, UN Special Coordinator for the Middle East Peace Process Nickolay Mladenov issued a statement early Thursday morning, saying: “Our collective efforts have prevented the situation from exploding until now. If current escalation, however, is not contained immediately, the situation can rapidly deteriorate with devastating consequences for all people.”

Palestinian Authority President Mahmoud Abbas called on the international community to intervene to stop what he termed the “Israeli escalation on our people in the Gaza Strip,” according to the official Palestinian news agency, WAFA. Such intervention was needed, Abbas said, to prevent “further destruction and instability.”

A spokesman for Hamas, Abdul Latif al-Qanoa, said: “The Palestinian resistance is defending its people against the ongoing Israeli aggression on Gaza as part of its national duty.”

However, US envoy Jason Greenblatt blamed Hamas for the violence. “This is the Hamas regime’s choice,” he tweeted. “Hamas is subjecting people to the terrifying conditions of war again.”

The escalation came after Hamas leaders traveled to Cairo in recent days to discuss the possibility of a long-term ceasefire with Israel.

Khalil al-Hayya, a member of Hamas’ political bureau, said in a televised interview on Al Jazeera on Wednesday that the general layout of a ceasefire agreement was in “advanced stages.”

Israel’s security cabinet has also discussed possible options relating to Gaza.

Israeli Minister of Transportation Israel Katz said over the weekend on Twitter: “The situation in Gaza is reaching a decision – or an arrangement or a war.” Katz said he would support an Egyptian-backed agreement that provided aid and rehabilitation to Gaza.

But on Sunday, following a security cabinet meeting to discuss the situation in Gaza, a readout of the meeting from the Prime Minister’s office said only that the IDF chief of staff had briefed the cabinet on the latest developments in Gaza. No decisions had been made.

Months of violence

Earlier Wednesday, an Israeli tank struck a Hamas post in northern Gaza, after gunfire from Gaza damaged an Israeli engineering vehicle near the border fence.

In a separate incident on Tuesday, an Israeli tank struck a Hamas military post in northern Gaza, killing two militants. Israel carried out the strike after the IDF claimed Hamas snipers fired at Israeli security forces near the border. Hamas says the two men were taking part in an exercise and did not fire at Israel.

Hamas vowed to avenge the deaths, prompting Israel to shut down roads near Gaza for security reasons.

Palestinians rush to the border fence with Israel as mass protests take place on May 14 in Gaza City.

Efforts to achieve a comprehensive ceasefire come after months of violence along the Israel-Gaza border.

In late March, Palestinians began weekly protests dubbed the “Great March of Return” along the border fence. More than 160 Palestinians have been killed by Israeli fire in the protests, according to the Palestinian Ministry of Health.

Israel has accused Hamas, which controls Gaza, of orchestrating the protests, during which the IDF says rioters have thrown Molotov cocktails, burned tires and hurled grenades. An Israeli soldier was killed by sniper fire from Gaza in late July, the first soldier killed along the Gaza border since the 2014 war.

Israel has maintained a land, sea and air blockade on the coastal enclave since June 2007, when Hamas took over Gaza.

The blockade effectively locks the more than 2 million Gaza residents inside the territory and is seen by the United Nations as a major contributor to the deterioration of living conditions there. Israel says it’s a necessary security measure.

CNN’s Abeer Salman, Ibrahim Dahman and Dakin Andone contributed to this report.