After a heavy exchange of fire early Sunday between Israel and Iran-backed Shiite militia Hezbollah, the regional military powers signaled a desire to avoid a spiral that could lead to a wider Mideast conflict.

Hezbollah launched hundreds of rockets and drones at Israel as around 100 Israeli warplanes struck targets in Lebanon in a move Israel said was intended to pre-empt a Hezbollah attack. The exchange was a significant show of force but initially appeared to result in few casualties and limited damage.

Hezbollah said Sunday its operation for the day had concluded.

“We said this was a preliminary response,” Hezbollah leader Hassan Nasrallah said in an address Sunday. “If we assess that the impact of the preliminary response was not satisfactory, we will act accordingly. For now we consider that the response is over, and the country can take a breath.”

The Middle East has been on edge for weeks, waiting to see how Hezbollah and its patron Iran would respond to a pair of Israel-linked killings of senior figures from Hezbollah and Palestinian Islamist militant group Hamas in Beirut and Tehran.

Hamas, the Yemen-based Houthis and other Iran-backed militias congratulated Hezbollah on the operation. Iran, which had vowed to retaliate for the killing in Tehran, has remained largely silent.

Israel said after the attacks that its military was back in a defensive posture, though it continued to strike some targets in southern Lebanon as it has for the past 10 months.

If the relative calm holds, the low number of announced casualties could give each of the combatants room to return to their pattern of lower-level skirmishing and avoid the wider war the U.S. has tried for months to head off.

Hezbollah doesn’t want a wider war and might be satisfied by Sunday’s result, said Danny Citrinowicz, who served as head of the Iran branch for the Israeli military and is now a fellow with the Tel Aviv-based Institute for National Security Studies.

“They were willing to risk an escalation to balance the deterrence equation, but I don’t think a war,” Citrinowicz said. “For now, everybody can be content.”

Mohanad Hage Ali, deputy director for research at the Malcolm H. Kerr Carnegie Middle East Center in Beirut, said the limited casualties on the Israeli side made clear Hezbollah wants to keep the conflict contained.

The outcome echoed a showdown in April, when Iran retaliated for an Israeli strike that killed a group of its military officers meeting in Damascus.

Iran responded by launching a barrage of 300 missiles and drones—its first direct attack on Israel and a much more dangerous mix of weapons than Sunday’s—but telegraphed its plans and did little damage. Israel responded with a limited strike on Iran, after which both sides moved on.

At the same time, officials in the U.S. and around the region are concerned that continued exchanges of fire, sometimes at elevated levels, can’t be expected to remain contained given the risks of targeting errors and miscalculations.

Separately, Hamas claimed responsibility for a rocket that landed in central Israel on Sunday night, a rare attack from the group on Israel’s most densely populated area. Israel’s military said the rocket landed in empty land and no casualties were reported.

Israel is growing impatient with the cross-border violence that has made its northern reaches unlivable. Sunday’s pre-emptive attack demonstrated an appetite for tougher action.

Hezbollah started firing into Israel on Oct. 8, a day after Hamas led the attacks on southern Israel that left 1,200 people dead and set off the war in the Gaza Strip. Israel responded, and the two have exchanged fire across the Lebanese border for the past 10 months.

The sharp, new uptick in tensions began in July, when a rocket fired from Lebanon killed 12 young people on a soccer field in the Israeli-controlled Golan Heights. Israel blamed Hezbollah and retaliated by killing top commander Fuad Shukr with a strike in Beirut.

Hours later, Hamas political leader Ismail Haniyeh was killed by an explosion at a military guesthouse that Iran blamed on Israel. Hezbollah and Iran vowed to respond.

Alarmed, the U.S. pushed forward a new round of cease-fire talks for Gaza. It also beefed up its military assets in the Middle East to help defend Israel from any attack, including bringing in a second aircraft-carrier group and a guided-missile submarine.

Chuck Freilich, a former deputy national security adviser in Israel, said the possibility of a broader escalation will remain if the status quo of daily tit-for-tat attacks doesn’t change.

Tens of thousands of people on both sides of the border have been displaced by the months of fighting. Israel’s government is under heavy pressure from residents in the north to get them back into their homes.

The military has said if the threat can’t be resolved diplomatically, it will have to be done with force. Defense Minister Yoav Gallant has pushed for a cease-fire deal in Gaza that would return hostages taken by Hamas and help calm tensions on the northern border.

But there is also a growing number of current and former security officials, as well as politicians from the center as well as the far right, who think the time is right to go on the offense and push back Hezbollah. The militant group has massed more than 100,000 rockets, missiles, drones and other projectiles along  Israel’s northern border  over a period of several years.

Amir Avivi, a former senior military official who heads a security-oriented think tank in Israel, said war between Israel and Hezbollah remained inevitable and imminent despite Sunday’s events, as Israelis displaced from the north are still unable to return.

Sunday’s fighting got under way before dawn, when Israel’s military hit dozens of targets in Lebanon in what it called a pre-emptive strike. The U.S. and Israel had recently obtained intelligence that Hezbollah planned to attack early Sunday, U.S. officials said. Israel briefed the U.S. on its plans before going ahead.

Nasrallah said the attack had two phases—a barrage of 340 rockets at northern Israel and a launch of attack drones farther into the country. Among the targets was the headquarters of Israel’s spy agency, Mossad, just north of Tel Aviv, Nasrallah and a person familiar with the matter said. Nasrallah said Hezbollah also targeted a Tel Aviv-area base of the Israeli military’s Unit 8200, which is responsible for signals intelligence and cyber.

Israel knocked out about two-thirds of the projectiles that Hezbollah planned to launch Sunday morning, a senior Israeli official said. Prime Minister Benjamin Netanyahu said all of the drones launched at a “strategic target in the center of the country” were intercepted.

One Israeli sailor was killed by shrapnel from an Israeli rocket interceptor that exploded over his boat, a military spokesman said. Hezbollah said two of its members were killed.

The U.S. wasn’t directly involved in Israel’s operation, but it did provide some intelligence, surveillance and reconnaissance support, a Pentagon official said.

The Biden administration assesses Israel and Hezbollah won’t soon engage in another round of major fighting, U.S. officials said. Despite that, officials said Sunday they have no immediate plans to change the bolstered U.S. military presence in the region.

The show of force may have contributed to Hezbollah’s choice of a relatively restrained option despite pressure to respond to Shukr’s killing, said Orna Mizrahi, a Lebanon expert at the Tel Aviv-based Institute for National Security Studies.

“I think the massive American presence was a deterrent,” she said.

Write to Dov Lieber at dov.lieber@wsj.com , Alexander Ward at alex.ward@wsj.com and Nancy A. Youssef at nancy.youssef@wsj.com