Hamas late Wednesday said that it has reached understandings with the Israeli military regarding a cessation of hostilities on the Gaza frontier.The Palestinian Islamist group claimed that Egypt mediated a truce with Israel after 24 hours of escalation and tit-for-tat attacks, Arab press reports said.According to the terms of the understandings, the IDF will withdraw some of its troops while halting all operations along the security fence that separates Gaza from Israel.In exchange, Hamas will adhere to the cease-fire that has been in effect since the end of Operation Protective Edge.Musa Abu Marzouk, a senior official in Hamas' political bureau, posted a notice on his Facebook page which read: "What happened on the Gaza border was a Zionist attempt to impose a new reality there. This demanded that Hamas rise up in order to prevent the Israeli army from taking action. We spoke with our brothers in Egypt who are overseeing the recent cease-fire, and they reacted quickly, which led to a return to the status quo ante."Hamas carried out a series of mortar attacks targeting IDF units on the border with northern and southern Gaza on Wednesday, prompting the IDF to respond with tank fire and later five air strikes on Hamas targets in the Strip’s south.The escalation – the most significant since the August 2014 cease-fire that ended a two-month conflict – came as Hamas sought to disrupt IDF work to detect its attack tunnels.Two mortar shells exploded near IDF units opposite southern Gaza and three near northern Gaza. On Tuesday, small arms fire targeted an IDF engineering vehicle, and a blast was later heard by security forces.There were no casualties in Wednesday’s incidents.The IDF Spokesman’s Office said in a statement, “The IAF struck five Hamas targets in southern Gaza in response to two days of cross-border fire on IDF units carrying out operational work near the border.The IDF views underground terrorism and overground terrorism activities as a breach of the State of Israel’s sovereignty, and views the Hamas terrorist organization as being solely responsible.”The IDF vowed to continue to act “with determination, and as much as is needed, to destroy all of the underground tunnels,” adding: “A quiet and ordinary routine is of mutual interest, and we will seek to preserve it.”Hamas’s military wing, Izzadin Kassam, released its own statement, saying, “We will not allow a continuation of Zionist aggression against the Gaza Strip. The enemy must not use any excuse, and it must leave the Gaza Strip immediately and deal with its fear and the fears of its residents outside of the buffer zone. The Zionist intrusions, since yesterday evening, constitute a clear breach of the 2014 agreement to achieve calm, and a new aggression against the Strip.”Hamas added that IDF engineering units “intruded through various roads since Tuesday morning, going 150 to 200 meters east of Rafah into the buffer zone, heading west, south and north. The second route – east of Gaza – [saw an intrusion of] 200 meters into the buffer zone, heading west, and 300 meters heading north and south, causing damage to the property of residents. This is continuing.”Army Radio cited defense sources as saying that IDF units did not breach the 100-meter security perimeter.The first Hamas attack occurred on Wednesday morning, when a mortar shell exploded near an IDF unit carrying out operational work on the Gaza border fence near Kibbutz Nahal Oz, prompting tanks in the area to fire on a Hamas position.Hours later, a second explosion occurred on the northern border of Gaza in the afternoon. Subsequent attacks occurred from southern and northern Gaza.On Tuesday, Prime Minister Benjamin Netanyahu visited the Gaza border with defense chiefs, saying that the past two years since the conclusion of Operation Protective Edge have been the quietest since Hamas took over the coastal enclave in 2007.Netanyahu, who went to the site of a large terrorist tunnel from Gaza into Israel that was discovered last month, was accompanied by Defense Minister Moshe Ya’alon, IDF Chief of Staff Lt.-Gen. Gadi Eisenkot, OC Southern Command Maj.- Gen. Eyal Zamir and other top IDF officials. He received a briefing there on the security situation in the area.Speaking to Golani soldiers in a grove of eucalyptus trees, Netanyahu compared the situation today, where IDF soldiers are defending the country, to the situation 70 years ago during the Holocaust, when “we were like a leaf driven in the wind, with no defense force, helpless. They massacred us, slaughtered us.”Today, he said, “we have a country, an army, the ability to defend ourselves in this sector, in all sectors – near and far – and what motivates me is to secure the future of Israel in its land.”The Jewish people, he said, has no future without its country.Netanyahu praised the soldiers for their spirit, saying this is what makes the army what it is.Herb Keinon contributed to this report.