Since the war in Gaza began after Hamas’s surprise attack on Israel on Oct. 7, people across the Middle East have feared it could set off a second war between Israel and Hezbollah, the powerful Lebanese militia, and ignite a broader regional conflagration.

That is not Hezbollah’s plan, the group’s leader, Hassan Nasrallah, said in a widely anticipated address to his followers on Friday, his first public remarks since the start of the war.

Hezbollah, he said, was already doing what it set out to do: exchanging fire with a portion of Israel’s military to keep it tied up along the northern border with Lebanon, reducing the burden on Hamas.

“The Lebanese front has lessened a large part of the forces that were going to escalate the attack on Gaza,” Mr. Nasrallah said. “Some in Lebanon say that we are taking a risk, it’s true. But this risk is part of a beneficial, correct calculation.”

Israel and Hezbollah have clashed repeatedly along the Israel-Lebanon border since the war began, targeting each other’s positions and killing combatants on both sides. Mr. Nasrallah’s address, which lasted more than an hour and repeatedly erupted into fiery crescendos, was far from a call for peace.

But it fit with analysts’ assessment that Israel and Hezbollah appeared to be calibrating their actions to avoid setting off a broader war. Mr. Nasrallah described Hezbollah’s objective as a controlled battle along the border aimed at sapping Israel’s morale and resources.

That message was most likely a disappointment to Hamas, a Hezbollah ally that is also supported by Iran, some of whose leaders have called on their regional partners to do more in the fight against Israel. Israel, the United States and other countries consider both groups terrorist organizations.

During one of the most tense periods in the Middle East in recent years, though, Mr. Nasrallah’s speech offered a small measure of relief for many, that at least one powerful force was not seeking to plunge the region into even greater violence.

Hezbollah is a more powerful and sophisticated military force than Hamas, with tens of thousands of trained fighters, an arsenal of more than 100,000 rockets and a stock of precision-guided missiles that can strike sensitive targets deep inside Israel. Military analysts believe that the group may also have other military capabilities that it has yet to unveil.

Mr. Nasrallah is a highly respected figure inside the a group that calls itself the “axis of resistance,” a network of Iranian-backed militias in several Arab countries that share an anti-American and anti-Israeli ideology and have come to coordinate their operations more closely in recent years. A decision by Hezbollah to launch a full-on war with Israel would most likely encourage attacks by an assortment of allied militias in Iraq, Syria and Yemen.

During his address, which was livestreamed to large gatherings of Hezbollah supporters around Lebanon, Mr. Nasrallah lashed out at the United States for its staunch support for Israel, accusing President Biden of dishonesty in telling Israel that it had the right to defend itself but that it had to respect human rights.

“Empty talk! Hypocrisy!” Mr. Nasrallah boomed.

He also said the group was not intimidated by the two aircraft carriers that the United States had dispatched to the eastern Mediterranean, which could strike Hezbollah targets.

“Your fleets in the Mediterranean do not scare us and will never scare us,” Mr. Nasrallah said. “ Your fleets that you threaten us with, we are prepared for them as well.”

Should the United States intervene directly in the war, Mr. Nasrallah said, it could expect attacks by Hezbollah’s allies on its military bases and other targets in Iraq, Syria and elsewhere.

The U.S. military has said the carriers were sent to deter a wider regional war — a fear that has grown alongside mounting anger in Arab countries over the crisis facing Gazan civilians and the death toll in the strip, which has risen into the many thousands since Israel’s bombardment began. Israel has faced increasing international criticism over the dire conditions in Gaza, but has so far resisted calls for either a cease-fire or humanitarian “pauses” to help deliver aid.

Mr. Nasrallah praised the fighters from his and other armed groups in Lebanon, saying they were launching daily attacks on Israeli military positions and destroying communications infrastructure. Those attacks had forced Israeli civilians to flee and drawn Israeli military resources to the north so that they could not contribute to attacks on Gaza.

He acknowledged that the possibility of a regional war still existed, but said that it could be avoided if Israel halted its attacks on Gaza. His forces were ready in any case, he said, should hostilities escalate.

“All the possibilities on our Lebanese front are open,” he said. “All the choices are available and we could resort to them at any time.”

Thousands of Hezbollah supporters gathered to watch the speech on giant screens in locations throughout Lebanon. The largest site, in Beirut’s southern suburbs, was decorated with Hezbollah and Palestinian flags. Celebratory gunfire rang out when he appeared onscreen, and supporters chanted, “We are here for you, Nasrallah.”

Early in the speech, Mr. Nasrallah praised Hamas for carrying out the Oct. 7 attack, which included assaults on large groups of civilians and killed more than 1,400 people in Israel. The Hezbollah leader said that no battle was more justified from a religious, moral or humanitarian perspective than “the battle with these Zionists.”

He said that Israeli treatment of the Palestinians had gotten so bad that a “great event” had been required to restore the Palestinian cause as “the No. 1 issue in the world.”

In Beirut, Mohamad Sbeti, 40, fired a volley of celebratory gunshots into the air with a pistol after Mr. Nasrallah finished speaking. He said he would answer any call by Hezbollah to fight Israel.

“We don’t want war,” he said. “But if war comes, me, my two boys and my wife will go and fight.”

A driver who had grown poorer during Lebanon’s deep economic crisis in recent years, Mr. Sbeti was not overly worried about the vast damage that Israel could do to Lebanon in a new war.

Why should I be afraid?” he said. “We have nothing to lose.”

Euan Ward and Hwaida Saad contributed reporting from Beirut.