Updated

The Israeli military said it shot and captured a Palestinian who approached the Gaza perimeter fence and hurled grenades into Israel on Wednesday, in the first confrontation since Hamas and other militant groups in Gaza accepted an Egyptian-brokered cease-fire to end two days of intense fighting that had pushed the sides to the brink of another war.

The military said it spotted the assailant with a knife and wire cutters and took him into custody after the grenades he hurled failed to explode.

The frontier was quiet overnight after the most intense round of fighting since a 50-day war in 2014. Palestinian militants fired 460 rockets and mortars into Israel in a 24-hour period, while the Israeli military carried out airstrikes on 160 Gaza targets. Seven Palestinians, including five militants, were killed. In Israel, one person was killed in a rocket strike and three were critically wounded.

With air raid sirens wailing throughout southern Israel and the explosions of airstrikes thundering in Gaza, the two sides had appeared to be on the verge of their fourth war in a decade. Instead, Gaza's Hamas rulers abruptly announced a cease-fire and Israel's Security Cabinet ended a seven-hour discussion with an apparent decision to hold its fire.

The news was greeted with celebrations in Gaza, with Hamas declaring victory in the latest round of violence, which was triggered by a botched Israeli raid on Sunday that left seven Palestinian militants and a senior Israeli military officer dead.

Hamas has staged near-weekly border protests since March in an effort to lift the Israeli-Egyptian blockade imposed after the Islamic militant group seized control of the coastal strip in 2007. The blockade has ravaged Gaza's economy, and Israel refuses to lift it unless Hamas disarms, a demand rejected by militant group, which is pledged to Israel's destruction.

Demonstrators each week have approach the border fence, throwing firebombs, grenades and burning tires at Israeli troops. Israeli snipers have killed about 170 people, most of them unarmed. Israel says it is defending its border against attackers, but it has come under heavy international criticism for shooting unarmed people.

Before Sunday's raid, Egyptian and U.N. mediators had made progress in reducing tensions. In recent days, Israel had allowed fuel shipments to increase the power supply in Gaza, which suffers from frequent blackouts, and agreed to additional Qatari assistance to allow Hamas to pay the salaries of its thousands of government workers.

The standoff has produced repeated rounds of violence in recent years, including indiscriminate Gaza rocket fire at Israeli towns and cities and punishing Israeli military offensives, but Hamas remains firmly in control. Both sides appear reluctant to launch a full-scale war.

In southern Israel, news of the cease-fire was greeted with anger as dozens of protesters in the rocket-battered town of Sderot chanted "Disgrace!" at what they saw as the government's capitulation to violence and its inability to provide them with safety. Recent months have seen sporadic rocket attacks as well as militant infiltration attempts and a wave of incendiary kites that have destroyed Israeli crops.

"We are third-class citizens here in Sderot and the communities on the border with Gaza," complained David Maimon, a local resident. "It's a shame. Instead of helping us and letting us live quietly, they let us suffer."

Israeli Prime Minister Benjamin Netanyahu presented the decision to step back from a full-blown conflict as a unified one made by his Security Cabinet and based on the military's recommendations. But two of the Security Cabinet's more hard-line members, Defense Minister Avigdor Lieberman and Education Minister Naftali Bennett, later expressed reservations, saying they favored a stronger response.

Lieberman is scheduled to deliver a statement later Wednesday.

The current round of violence began when an Israeli commando unit on an undercover mission was caught behind enemy lines in Gaza by Hamas militants, setting off a deadly battle late Sunday. Hamas and other militant groups responded with a wave of rocket attacks the following day.

The Israeli military said its jets struck several "key strategic" Hamas targets in response, including military compounds, rocket launching posts and part of its vast underground tunnel network. Also targeted were Hamas' TV station and a Gaza City building serving Hamas' military and intelligence forces that houses a munitions warehouse.