As the Obama administration builds its case for military strikes on Syria, Iran’s new president and his foreign policy team are steering clear of a confrontational tone even as they express support for Tehran’s longtime allies in Damascus.

On Wednesday, President Hassan Rouhani told a key decision-making body here that Syria’s stability and security remain top priorities, but he made no mention of offering military support to President Bashar al-Assad.

“If something happens to the Syrian people, the Islamic Republic of Iran will do its religious and humanitarian duties to send them food and medicine,” Rouhani told the Assembly of Experts. He described the situation in Syria as “dire” and condemned “military attacks on countries in this region, especially on Syria.”

It is not clear whether the change represents a significant shift. Iran, along with Russia, remains Syria’s most important ally, a source of material support and intelligence. It continues to express support for Assad, and its leaders have joined Syria in deriding rebel forces there as made up largely of foreign-funded terrorists.

Some members of Congress have warned in recent days that a U.S.-led strike on Syria in response to an alleged chemical attack could prompt retaliation from Iran or its proxies, including the Lebanon-based Shiite militia Hezbollah.

But the shift in tone from Tehran has become increasingly apparent in recent days, with public comments by Iranian officials and commentary in government-controlled newspapers suggesting that Tehran’s support for Assad may not be entirely unconditional. Iran’s state-run airwaves have lately been filled with programs reminding people that Iranians suffered chemical weapons attacks during the 1980-1988 war with Iraq.

Domestic broadcasters’ support for Assad has become muffled, though Iran has joined other Syrian allies in suggesting that rebels, and not the Syrian government, may have carried out the alleged Aug. 21 chemical attack that killed more than 1,000 civilians.

Iran’s offers to help secure a political solution to the conflict in Syria have long been dismissed by Western powers because of what they have described as Tehran’s unquestioning support for the Assad regime.

Some Iranian hard-liners have remained defiant in their anti-U.S. rhetoric, though they have stopped short of making specific threats.

Hossein Salami, a commander in Iran’s Revolutionary Guard Corps, said Wednesday that any American attack on Syria would “endanger U.S. national security.” Col. Mohammad Reza Naghdi, the head of the Basij paramilitary organization, said any “illegal invasions” could lead to “larger responses against the U.S.”

American officials and other experts have been watching closely to see whether Rouhani and his government might adopt a softer approach to foreign policy than his virulently anti-U.S. predecessor, Mahmoud Ahmadinejad. Local analysts say the differences in tone should not be seen as reflecting internal political struggle over Iran’s support for Assad.

“Among Iranian authorities, support for Syria is unanimous, but we must not expect politicians and military personnel to talk the same way,” said Hossein Royvaran, a ­Tehran-based political analyst who specializes in Arab affairs.

In a Sunday interview with the domestic weekly Aseman, Iran’s new foreign minister, Mohammad Javad Zarif, provided the clearest criticism yet of the Assad regime by any Iranian official.

“We believe that the government in Syria has made grave mistakes that have, unfortunately, paved the way for the situation in the country to be abused,” said Zarif, a U.S.-
educated former ambassador to the United Nations.

The comments, widely reported in the domestic media, appeared to reflect an Iranian belief that U.S. missile strikes on Syria are likely. “We hope that logic and wisdom would finally prevail and prevent a war. The realities on the ground, however, show that the drums of war are being beaten,” Zarif said.