When Iran launched a barrage of airstrikes this week into Iraq, Syria and Pakistan, it was not just showing off the reach and sophistication of some of its newest missiles but also staking a claim: This is a new era in which Iran can flex its muscles at will and, as an added benefit, bolster its credentials as an important arms supplier.

In at least one of the attacks — a strike that Tehran claimed targeted the Islamic State terrorist group in Idlib, Syria — Iran appeared to make use of one of its longest-range and most advanced missiles, the Kheibar Shekan. Both the range and the apparent accuracy seized the attention of national security officials in Europe and Israel, as well as outside experts who track Iran’s technological advances.

The combination of its newest missiles and its fleet of drones, which Russia has been purchasing by the thousands for use in Ukraine, has helped Iran become the producer of some of the most sophisticated weaponry in the Middle East.

And Tehran’s willingness to intervene — as a supplier to its proxy forces in the region and to Moscow — may well complicate American calculations as the Pentagon considers the question looming over the widening Middle East conflict: Could it lead to a direct conflict with Iran?

American plans to counter Iran were long built on the assumption that Tehran’s ability to inflict pain beyond its borders had its limits.

Its missiles were of dubious accuracy, and its drone program was still new. Its most potent weapons against the United States and its Western allies were largely cyberweapons. Even then, while it had landed some blows — crippling, for example, the Sands Casino — the global threat posed by Iran took a back seat to China and Russia.

But Iran’s ability to churn out drones by the thousands took a lot of officials by surprise. Now its missile capability is forcing the West to think about defenses and responses.

Mark Esper, who served as one of President Donald J. Trump’s defense secretaries, noted on Wednesday that “Iran is supplying, supporting, inspiring, funding all these activities” that have disrupted life in the Middle East and beyond, including the Houthis’ mounting attacks in the Red Sea.

“We have to get together with the Western democracies and the Arab states, quite frankly, and figure out a plan to deal with Iran to stop these flows,” Mr. Esper told CNN.

After Iran launched a drone attack against what it said was a terrorist group in Pakistan late Tuesday, Pakistan said on Thursday that it had retaliated with missile strikes against extremists in Iran.

Iran’s willingness to fire volleys of missiles at its adversaries, diplomats and experts agreed, is partly a venting of anger, partly a warning and partly a sales pitch to future customers.

Its run-of-the-mill missile, the kind sold to Houthi rebels in Yemen or to Hezbollah in Lebanon, can be combined with drones to overwhelm air defenses. But the Kheibar Shekan can strike farther, and with more accuracy, than anything the Iranians have fielded in the past.

Unveiled in 2022, the Kheibar Shekan is a solid-propellant precision-guided missile that has a range of 1,450 kilometers, or about 900 miles — meaning it can hit Israel. But what makes it stand out from the rest of Iran’s arsenal is that its warhead can nimbly maneuver with tiny aerodynamic fins to evade at least some traditional air-defense systems.

The use of the missile, when it was first deployed and again this week, suggests it is a favorite project of the Islamic Revolutionary Guards Corps, a branch of Iran’s military that is developing missiles separately, but in parallel, with a program run by the country’s Defense Ministry.

The decision to use the Kheibar Shekan this week in Syria when a less sophisticated missile would have been just as effective is being viewed as a sign that Iran may have been more interested in demonstrating its might to the West than in retaliating against a terrorist group.

“It was quite interesting to see that system being used,” said Fabian Hinz, a missiles, drones and Middle East expert at the International Institute for Strategic Studies in London. He added, “There’s a question whether they might have chosen it to test one of their most advanced missiles under combat conditions, or send a message to Israel or potentially do both.”

Overall, Iran has more than 3,000 ballistic missiles in its arsenal and is steadily adding to its stockpile of cruise missiles, according to U.S. intelligence and military estimates. Last year, Iran planned to spend 41 percent of its military budget on development and arms production, according to the Emirates Policy Center, a research organization based in Abu Dhabi. By comparison, its primary combat weapons, tanks and aircraft, are largely considered either aging or obsolete.

Iran’s missile production has surged over the past 15 years, as it has significantly improved the weapons’ precision, guidance and aerodynamics technology.

Over those years, Iran shifted from a more defensive posture in the Middle East to one in which the Revolutionary Guards have taken a more assertive role across the region, including joining forces with other Shiite Muslim militants in Iraq, Lebanon, Syria and Yemen.

This week’s attacks were likely to have been both an aggressive demonstration of Iran’s technological advances and a reminder that it is a regional power with an unabashed willingness to strike.

“There was probably the feeling among Iranian leaders that they needed to do something after the attacks,” said Mr. Hinz, the missiles expert. “Perhaps there was also this idea that, as there’s so much tension in the region, Iran can’t be seen as sitting on its hands.”

Iran’s ballistic missile program has grown from an arsenal of Scud missiles that it acquired from Libya and North Korea during the 1980s into precision weapons that are guided by satellite and GPS navigation, or infrared seekers, to hit specific buildings. Its stockpile is made up of medium- and short-range missiles, including some designed to strike battlefield targets just 20 kilometers (12 miles) away.

Iran has also begun to bolster its land-attack cruise missile program, including one used by the Houthis that is known as Quds. Mr. Hinz said the Houthis have claimed new versions of that missile, which was either provided by Iran or copied from an Iranian model, has a range of 2,000 kilometers (1,250 miles). Iran has said that a variant in its own arsenal, the Paveh missile, has a range of about 1,650 kilometers.

The missile programs are a vital part of Iran’s military and most likely a top reason that Tehran’s defense budget ranked as the world’s 10th largest in 2022, according to the most recent analysis by the International Institute for Strategic Studies.

In the past few weeks, Mr. Hinz and American intelligence officials say, Iran and Russia have appeared to be moving closer to an agreement that would expand their arrangements on the Iranian supply of drones to include ballistic missiles, as well.

That could prove decisive on the battlefield in Ukraine, where the Russians have moved in recent weeks to a strategy of trying to overwhelm Western-provided air defenses by unleashing barrages of missiles at large Ukrainian cities, industrial areas and ports.

Mr. Hinz said it was more difficult to know precisely what missiles Iran has given its Hezbollah allies, who are notoriously secretive about their capabilities. But the Kheibar Shekan — or at least an exact copy of it — has been shown off by the Houthis in Yemen.

The Kheibar Shekan is named for a seventh-century battle in which Muslim forces defeated Jewish tribes.

“So you can see the mission of the missile,” Mr. Hinz said.