Four years ago, the U.S. launched a drone strike to kill the man who headed up Iran’s covert paramilitary operations. Qassem Soleimani had an almost cultlike following as the Middle East’s perhaps most recognizable military commander, and had placed his Quds Force atop a web of regional militias that over two decades had extended Iran military influence across the Arab world. His funeral procession drew such huge crowds that more than 50 people were killed in a stampede.

The man who succeeded him is very different, an unassuming backroom dealer who now faces a difficult new task—using this patchwork of armed groups to expand Iran’s footprint without provoking a devastating reprisal from the U.S.

Since taking over the Quds Force, Brig. Gen. Esmail Qaani has quietly worked to consolidate the various militias working under Iran’s direction from Baghdad to the Red Sea, where they have created what the U.S. government calls the most volatile situation in the Middle East in decades.

From the Houthi rebel movement in Yemen to Shia paramilitaries in Syria and Iraq, Qaani’s militia clients have the potential to inflame a cascading series of conflicts triggered by Hamas’s Oct. 7 attack, and draw the U.S. further into the morass by targeting American bases, such as the drone strike that killed three U.S. soldiers in Jordan more than a week ago. When the U.S. responded with strikes on Iran-backed militias across Syria and Iraq at the weekend, it was a message directed squarely at Qaani: Back off.

Whether Qaani will be able to put a lid on the militias, freshly galvanized by Israel’s war in Gaza and stung by the American attacks, is perhaps the greatest source of uncertainty across the region.

The U.S.’s killing of Soleimani was a specific attempt to dislocate the chain of command running from Tehran to its armed allies operating from Syria and Iraq to Yemen, Lebanon and the Palestinian territories. But it didn’t degrade their ability to upend the region; it just made them more freewheeling, disrupting shipping in the Red Sea, attacking Israel and posing a growing threat to American forces.

“If the aim was to diminish Iran’s control of these groups, the United States achieved that. That’s where the problem comes from,” said Hamidreza Azizi, visiting fellow and expert on Iran’s regional policies at the German Institute for International and Security Affairs, or SWP.

Iran’s Supreme Leader Ayatollah Ali Khamenei and President Hassan Rouhani pray near the coffins of Iranian Major-General Qassem Soleimani, head of the elite Quds Force, and Iraqi militia commander Abu Mahdi al-Muhandis, who were killed in an air strike at Baghdad airport, in Tehran, Iran January 6, 2020. Official Khamenei website/Handout via REUTERS

Indeed, the Quds Force commander has spent weeks since Hamas’s attack on Israel shuttling between the militias to tell them to make sure their attacks against Israel and U.S. bases aren’t so severe that they end up triggering a broader regional war, according to a Western security official, a senior Lebanese official and an adviser to Iran’s Revolutionary Guard.

Secretary of State Antony Blinken warned last week that “we’ve not seen a situation as dangerous as the one we’re facing now across the region since at least 1973, and arguably even before that,” referring to the year of the Yom Kippur War.

Soleimani had been instrumental in arming and training Iran’s alliance of nonstate actors. He was arguably the region’s most recognizable commander, with an almost mythical aura among his followers and a public image cultivated by the Iranian leadership as evidence of its growing influence in the Middle East.

“Soleimani was thought about as a once-in-a-lifetime figure, a generational player. They don’t come down the pike so often,” said Ray Takeyh, an expert on Iran’s Revolutionary Guard with the Council on Foreign Relations, an American think tank. “Qaani is a more understated figure.”

Born in the late 1950s, Qaani has revealed few biographical details to the public. A bureaucrat, he spent much of his career overseeing Iran’s interests in Afghanistan and spoke little to no Arabic. Unlike other senior figures in Tehran, he doesn’t appear to have played an active role in the 1979 Islamic Revolution, joining the Revolutionary Guard, formed to defend the new rulers, a full year later, in 1980.

He befriended Soleimani in the early 1980s on the southern front during Iran’s war with Iraq, and later said the fighting forged a deep friendship between them.

“We are all war kids,” he said in a 2015 interview, cited by Ali Alfoneh, an expert on the Revolutionary Guard. “Those who become friends at times of hardship have deeper and more lasting relations than those who become friends just because they are neighborhood friends.”

In the 1990s, following the war, Qaani rose in the ranks and as deputy chief of the Guard’s ground forces turned his attention to Afghanistan, where he fought drug smugglers and later supported the anti-Taliban Northern Alliance, which worked with the U.S. to topple the Taliban in 2001. When Soleimani mobilized tens of thousands of fighters to defend the Syrian government against Islamic State forces during the civil war there, Qaani helped recruit Afghan Shiites to join their ranks.

As the wars in Iraq and Syria waned, the role of Iran’s militia network changed. Many became part of the political fabric—in Lebanon, where Hezbollah is both a political party and viewed as a deterrent against attacks from Israel, and in Yemen, where the Houthis have captured the capital and are viewed as the de facto government.

In Iraq, the militias integrated deeper into the country’s political and security system, gaining power to influence national politics, while remaining outside state control.

Receiving funding and arms from Iran, the groups all operated within an overall framework established by Tehran, but with the autonomy to pursue their own domestic agendas. The groups’ growing self-sufficiency relieved Tehran of some of the economic burden of financing them, but also lessened its ability to restrain them.

This is a problem for Iran.

Whereas Soleimani used his charisma to mobilize what he called “the axis of resistance,” Qaani has sought to tie Iran’s disparate allies closer together at an operational level, Takeyh said.

“And that requires more of a backroom conversation than a cult of personality like Soleimani,” he said.

Arash Azizi, a historian at Clemson University, S.C., and the author of a biography on Soleimani, said that is especially true for the Iraqi militias, perhaps the most volatile of all the pieces in the Quds Force network.

“Soleimani had built a relationship with them over the years and was respected by them tremendously,” he said. “Qaani lacks the charisma and history of relationship with these Iraqi and other Arab groups…As a result, Qaani struggles much more in keeping the Iraqi groups in check and in line with the broader axis. Same problem exists in relation to Houthis who are more independent-minded.”

With the Middle East on the brink of what could be a broader conflict, Qaani and other Iranian officials are working to ensure that their militias don’t provoke further attacks.

After the drone strike in Jordan, Iranian officials traveled to Iraq to tell its allies there that the attack had crossed a line by killing American troops, according to a senior adviser to the Iranian government who participated in the meetings.

U.S. officials say they have yet to see evidence that Iran ordered the attack, and Iran wouldn’t gain anything from killing American troops, Azizi of SWP said.

“The aim since October 7 has been to keep the other fronts busy to provide some breathing space for Hamas, but without inviting broader conflict or a U.S. attack,” he said. “It doesn’t fit into the Iranian pattern of escalation, and wouldn’t serve any of Iran’s strategic aims at the moment.”

The question now is whether the militias will listen.

—Costas Paris contributed to this article.

Write to Sune Engel Rasmussen at sune.rasmussen@wsj.com