THE chemical attack on a suburb of the Syrian capital, Damascus, which left more than 1,400 people dead on August 21st, has put Iran’s new president in a particularly tricky position, barely a month into the job. Hassan Rohani, who was elected partly on the basis that he might persuade America to remove the crippling sanctions it has imposed on the Iranian economy, now faces the prospect of getting dragged into a war with his negotiating partner.

In the circumstances, Mr Rohani has fared quite well. Like Russia, Iran says the attack was the work of the Syrian rebels and not the government of President Bashar Assad, its most important ally. But Mr Rohani has steered clear of explicitly defending the Syrian regime, instead choosing simply to condemn the use of chemical weapons. After all, tens of thousands of Iranian soldiers were killed as a result of Saddam Hussein’s chemical weapons in the eight-year-long Iran-Iraq war in the 1980s.

Mr Rohani has made much of the widely-held view that a likely American strike on Syria is part of a longstanding ploy to bolster the rebels ahead of the proposed Geneva II conference, which would seek to stop the fighting. “Western countries have found some excuse to prepare the ground to weaken the stance of Syria in further talks,” Mr Rohani said. Still, Iran seems to be seeking to present a softer line.

The country has little to gain from getting swept up in military conflagration over Syria, particularly as the regime currently has the upper-hand in the civil war and putative American strikes are unlikely decisively to shift that balance. But it may have plenty to lose: becoming sucked into a war with the Americans would scupper all hope of sanctions relief and detente with the West.

Iran’s support for Syria and Hizbullah, the Lebanese Shias’ party-cum-militia, is part of a wider strategy to stymie America and Israel in the Middle East. Yet after two years of financing an increasingly volatile civil war that could end up threatening its wider interests, particularly in Lebanon and Iraq, some say that Iran may be becoming less inclined to fight for Mr Assad at all cost. Akbar Hashemi Rafsanjani, a pragmatic Iranian former president, has accused the Syrian government of carrying out the chemical attack. And Ahmad Shohani, a member of parliament, has said that Syria’s government should not expect Iran to get into a direct war with the West in the case of an American strike. Logistically, Syria has been useful for Iran in order to support Hamas, the Palestinians’ Islamist movement that rules Gaza. But now that much of the Syrian border with Israel is held by the rebels, such usefulness may be declining.