Now playing
00:10
This video is no longer available
TOPSHOT - Palestinian protesters pull a metal cable as they try to take down a section of barbed wire during clashes with Israeli forces on April 20, 2018, east of Khan Yunis, in the southern Gaza Strip during mass protests along the border of the Palestinian enclave, dubbed "The Great March of Return," which has the backing of Gaza
TOPSHOT - Palestinian protesters pull a metal cable as they try to take down a section of barbed wire during clashes with Israeli forces on April 20, 2018, east of Khan Yunis, in the southern Gaza Strip during mass protests along the border of the Palestinian enclave, dubbed "The Great March of Return," which has the backing of Gaza's Islamist rulers Hamas. (Photo by SAID KHATIB / AFP) (Photo credit should read SAID KHATIB/AFP/Getty Images)
PHOTO: SAID KHATIB/AFP/AFP/Getty Images
Now playing
02:11
The history of Gaza in 2 minutes
dpatop - Palestinian protesters use slingshots to hurl stones towards Israeli security forces during clashes along the Israel-Gaza border, on the 70th anniversary of Nakba Day (Day of the Catastrophe), which marks the displacement that preceded and followed the Israeli Declaration of Independence in 1948, in Khan Yunis, Southern Gaza Strip, 14 May 2018. Photo by: Wissam Nassar/picture-alliance/dpa/AP Images
dpatop - Palestinian protesters use slingshots to hurl stones towards Israeli security forces during clashes along the Israel-Gaza border, on the 70th anniversary of Nakba Day (Day of the Catastrophe), which marks the displacement that preceded and followed the Israeli Declaration of Independence in 1948, in Khan Yunis, Southern Gaza Strip, 14 May 2018. Photo by: Wissam Nassar/picture-alliance/dpa/AP Images
PHOTO: Wissam Nassar/picture-alliance/dpa/AP Images
Now playing
02:06
What sparked the latest Palestinian protests?
An injured Palestinian woman is carried by protesters as they run for cover during clashes with Israeli security forces following a demonstration commemorating Land Day near the border with Israel, east of Khan Yunis, in the southern Gaza Strip on March 30, 2018.
Clashes erupted as thousands of Gazans marched near the Israeli border in a major protest dubbed "The Great March of Return". / AFP PHOTO / SAID KHATIB        (Photo credit should read SAID KHATIB/AFP/Getty Images)
An injured Palestinian woman is carried by protesters as they run for cover during clashes with Israeli security forces following a demonstration commemorating Land Day near the border with Israel, east of Khan Yunis, in the southern Gaza Strip on March 30, 2018. Clashes erupted as thousands of Gazans marched near the Israeli border in a major protest dubbed "The Great March of Return". / AFP PHOTO / SAID KHATIB (Photo credit should read SAID KHATIB/AFP/Getty Images)
PHOTO: SAID KHATIB/AFP/AFP/Getty Images
Now playing
02:21
Palestinians: Over a dozen killed in protests
PHOTO: Abid Katib/OREL COHEN/AFP/Getty Images
Now playing
00:51
What's the Israeli-Palestinian two-state solution?
PHOTO: UNTV
Now playing
01:31
Haley to Abbas: US embassy decision is final
PHOTO: CNN
Now playing
07:22
Spokesman: Deliberate violence in Gaza
jerusalem palestine shuafat refugee camp liebermann pkg_00010911.jpg
jerusalem palestine shuafat refugee camp liebermann pkg_00010911.jpg
Now playing
02:00
Refugee camp island of isolation in Jerusalem
Now playing
02:36
Trump: Good chance for Middle East peace
A picture shows the skyline of Jerusalem with the Dome of the Rock mosque, at the Al-Aqsa mosque compound in the city?s old city, where thousands of Muslim pilgrims crowded for the first Friday noon prayer of Ramadan on September 5, 2008. Israel beefed up its police deployments in Jerusalem as tens of thousands of Muslim faithful were expected to attend the first Friday prayers of Ramadan at the Al-Aqsa mosque compound in the Old City. AFP PHOTO/MARCO LONGARI (Photo credit should read MARCO LONGARI/AFP/Getty Images)
A picture shows the skyline of Jerusalem with the Dome of the Rock mosque, at the Al-Aqsa mosque compound in the city?s old city, where thousands of Muslim pilgrims crowded for the first Friday noon prayer of Ramadan on September 5, 2008. Israel beefed up its police deployments in Jerusalem as tens of thousands of Muslim faithful were expected to attend the first Friday prayers of Ramadan at the Al-Aqsa mosque compound in the Old City. AFP PHOTO/MARCO LONGARI (Photo credit should read MARCO LONGARI/AFP/Getty Images)
PHOTO: MARCO LONGARI/AFP/AFP/Getty Images
Now playing
03:21
How the Six Day War reshaped the Middle East
exp ctw grief of a palestinian mother _00010203.jpg
exp ctw grief of a palestinian mother _00010203.jpg
Now playing
02:52
Israel-Palestine Conflict: Grief of a mother
Israeli forensics search at the scene of an explosion on a bus in Jerusalem on April 18, 2016.
Israeli forensics search at the scene of an explosion on a bus in Jerusalem on April 18, 2016.
PHOTO: THOMAS COEX/AFP/Getty Images
Now playing
01:09
Police: Bus explosion 'no doubt' was an attack
israeli police confirm device in bus fire liebermann_00001307.jpg
israeli police confirm device in bus fire liebermann_00001307.jpg
PHOTO: Getty Images
Now playing
03:05
Israeli police confirm explosive device in bus fire
Jerusalem bus explosion_00005513.jpg
Jerusalem bus explosion_00005513.jpg
Now playing
01:04
Bus catches fire in Jerusalem
(CNN) —  

Hours after violence flared between Israel and Hamas for the second time in a week, prompting renewed fears that Gaza could slide quickly into an all-out war, reports that a ceasefire has been restored surfaced.

The escalation began in the late afternoon, when an Israeli soldier died after being hit by gunfire during protests along the fence that separates Israel and Gaza, the Israel Defense Forces (IDF) said.

It was the first Israeli soldier killed on the fence since the last war between Israel and Hamas in 2014, the IDF said.

The IDF’s initial response was tank and artillery fire.

Four people were killed in that salvo, according to the Palestinian Ministry of Health.

Hamas, the militant group that runs the coastal enclave, said in a Whatsapp message to journalists that three of the four men killed were members of its armed Qassam Brigades.

The IDF said that, in addition to the shooting incident, there were also multiples explosives thrown toward Israeli soldiers during the unrest at the fence.

The Israeli air force then launched a series of what it called wide-scale attacks on dozens of Hamas military targets across the coastal enclave.

The IDF said it had succeeded in eliminating a Hamas battalion’s command and control capabilities, a drone warehouse, aerial defense systems and a factory used for underground infrastructure manufacturing, among other sites hit.

Later Friday, the army said at least three rockets were fired toward Israel from Gaza; two of the launches were intercepted by the Iron Dome aerial defense system.

There were no reports of any casualties from the rocket fire.

Nickolay Mladenov, the UN’s chief Middle East envoy, called on the two sides to step back from further escalation.

“Everyone in Gaza needs to step back from the brink. Not next week. Not tomorrow. Right NOW! Those who want to provoke Palestinians and Israelis into another war must not succeed,” he tweeted.

Israeli Defense Minister Avigdor Liberman told Mladenov in a phone conversation that if Hamas continued to fire rockets toward Israel, the response will be “much stronger” than they think, according to a statement Liberman’s office released.

“The responsibility for the destruction and the loss of life will be on Hamas,” Liberman said.

Hamas spokesman Fawzi Barhoum said in a statement, “Attack will be met with attack. Our people will continue until they get their rights and end the blockade, because they have the right to live freely.”

As Friday evening progressed, reports started to emerge that Egypt and the UN’s Mladenov were leading mediation efforts between the two sides.

And shortly after midnight local time (5 p.m. Friday ET), Hamas, and a diplomatic source with direct knowledge of the talks, told CNN that the ceasefire had been restored.

“Egyptian and international efforts have led to a return to the previous state of calm between the Occupation [a reference to Israel] and the Palestinian factions,” Hamas spokesman Fawzi Barhoum told CNN.

There was no immediate response from Israel to reports of the ceasefire restoration.

It’s the second time in six days that Egypt has brokered a ceasefire for Gaza following a serious escalation in violence.

Last Saturday, Israel pounded Gaza with dozens of airstrikes after the IDF said militants fired more than 200 rockets and mortars toward Israel.

A day after that ceasefire was announced, Israeli Prime Minister Benjamin Netanyahu told his weekly Cabinet meeting that Israel would never make any truce agreement that failed to take account of the arson attacks being launched from Gaza using kites and balloons.

Tension along the fence has been simmering for months, at times erupting into violence. Recent weeks have also seen a sharp increase in the number of arson attacks, a low-tech threat to which Israel has struggled to find an answer.

The violence has also stymied international attempts to alleviate conditions for the two million people living in Gaza.

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 UN as a major contributor to the deterioration of living conditions there. Israel says it’s a necessary security measure.

Ibrahim Dahman, Ameera Ahmad and Ian Lee in Gaza and Oren Liebermann in Jerusalem contributed to this report.