I ran’s calibrated early Wednesday morning response to the killing of a leading general in a United States airstrike suggests it is keenly aware of the domestic unpopularity and weaknesses of its primary adversary, Donald Trump, and is seeking to exploit American divisions to weaken Washington and help deliver a loss to the president in November.

In a rare direct attack on the US, Iran’s armed forces launched 22 cruise missile strikes against two bases that house American troops in Iraq.

But Trump said there were no US casualties, and Iranian officials have not warned of further attacks to avenge the killing of Revolutionary Guard Quds Force commander Qassem Soleimani, instead reiterating calls for American troops to leave the Middle East.

The lack of US casualties offered Trump a path to slow down a snowballing descent towards armed conflict with Iran. It also prevents Americans generally hostile to the administration from rallying around the flag, as they do they at times of war.

Speaking from the White House on Wednesday, Trump said Iran appeared to be “standing down”.

“If Iran didn’t want to separate the American people from vicious [Donald Trump] it would have carried out a more deadly attack on US military bases,” writes Diako Hosseini, an adviser to the Tehran government and director of the World Studies Programme at the Centre for Strategic Studies, an Iranian think tank affiliated with the foreign ministry, following the Iranian missile attack.

US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Show all 35 1 /35 US airstrike kills Iran's Qassem Soleimani: Fallout in pictures US airstrike kills Iran's Qassem Soleimani: Fallout in pictures This photo released by the Iraqi Prime Minister Press Office shows a burning vehicle at the Baghdad International Airport following an airstrike in Baghdad, Iraq, early Friday 3 January AP US airstrike kills Iran's Qassem Soleimani: Fallout in pictures The wreckage of the car in which general Soleimani was travelling when a targeted US airstrike struck outside Baghdad International Airport on 3 January Ahmad Al Mukhtar via Reuters US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Demonstrators burn the US and British flags during a protest in Tehran after general Soleimani was killed in a targeted airstrike by American forces Reuters US airstrike kills Iran's Qassem Soleimani: Fallout in pictures A burning vehicle at the Baghdad International Airport following an airstrike. The Pentagon said Thursday that the US military has killed general Qassem Soleimani, the head of Iran's elite Quds Force, at the direction of Donald Trump AP US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Protesters burn Israeli and US flags as thousands of Iranians take to the streets to mourn the death of general Soleimani at the hands of America EPA US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Supporters of Donald Trump pray at an 'Evangelicals for Trump' campaign event held on the day following the killing of general Soleimani. At the event, the president praised the "flawless strike that eliminated the terrorist ringleader" AFP via Getty US airstrike kills Iran's Qassem Soleimani: Fallout in pictures A huge procession of mourners gather in Baghdad for the funeral of general Soleimani on 4 January AP US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Thousands of Iranians take to the streets to mourn the death of Soleimani during an anti-US demonstration to condemn the killing of Soleimani, after Friday prayers in Tehran, Iran EPA US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Iraqis perform a mourning prayer for slain major general Qasem Soleimani of the Iranian Revolutionary Guards at the Great Mosque of Kufa AFP via Getty US airstrike kills Iran's Qassem Soleimani: Fallout in pictures A billboard reading 'Death to America and Israel', installed by Iran-backed shiite armed groups at a street in Jadriyah district in Baghdad, Iraq EPA US airstrike kills Iran's Qassem Soleimani: Fallout in pictures A handout picture provided by the office of Iran's supreme leader Ayatollah Ali Khamenei shows him visiting the family of Soleiman KHAMENEI.IR/AFP via Getty US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Thousands of Iranians take to the streets in Tehran EPA US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Pakistani Shiite Muslims burn a mock of a US flag as they hold pictures of General Qasem Soleimani during a protest against the USA, outside the US Consulate in Lahore, Pakistan EPA US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Iran's Ambassador to Lebanon Mohammed Jalal Feiruznia, looks to a portrait of Soleimani, as he receives condolences at the Iranian embassy, in Beirut, Lebanon AP US airstrike kills Iran's Qassem Soleimani: Fallout in pictures People make their way on the street while a screen on the wall of a cinema shows a portrait Soleimani in Tehran AP US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Aziz Asmar, one of two Syrian painters who completed a mural following the killing of Iranian Revolutionary Guards commander Qasem Soleimani poses next to his creation in the rebel-held Syrian town of Dana in the northwestern province of Idlib AFP via Getty US airstrike kills Iran's Qassem Soleimani: Fallout in pictures A demonstration in Tehran AFP via Getty US airstrike kills Iran's Qassem Soleimani: Fallout in pictures An anti-US demonstration to condemn the killing of Soleimani, after Friday prayers in Tehran EPA US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Mujtaba al-Husseini, the representative of Iran's supreme leader Ayatollah Ali Khamenei, delivers a speech in the holy shrine city of Najaf AFP via Getty US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Pakistani Shiite Muslims burn a mock of a US and Israeli flags as they hold pictures of General Qasem Soleimani during a protest against the USA, outside the US Consulate in Lahore, Pakistan EPA US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Protesters demonstrate in Tehran AP US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Pakistani Shi'ite Muslims hold pictures of General Qasem Soleimani during a protest against the USA, in Peshawar, Pakistan EPA US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Protesters, holding a photograph of the leader of the People's Mujahedin of Iran Massoud Rajavi, outside Downing Street in London PA US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Protesters burn a US flag in Tehran AP US airstrike kills Iran's Qassem Soleimani: Fallout in pictures A Syrian man offers sweets to children to mark the killing AFP via Getty US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Iranian worshippers attend a mourning prayer for Soleimani in Iran's capital Tehran AFP via Getty US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Kashmiri Shiite Muslims shout anti American and anti Israel slogans during a protest AP US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Iranian worshipers chant slogans during Friday prayers Reuters US airstrike kills Iran's Qassem Soleimani: Fallout in pictures A protest against the USA, in Islamabad, Pakistan EPA US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Iranians burn a US flag in Tehran EPA US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Supporters of the National Council of Resistance of Iran in Germany (NWRI) protest outside Iran's embassy in Berlin, Germany Reuters US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Supporters of the National Council of Resistance of Iran in Germany (NWRI) protest outside Iran's embassy in Berlin Reuters US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Iranian worshippers in Tehran AFP via Getty US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Vehicles of the United Nations Interim Forces in Lebanon (UNIFIL) patrol a road in the southern Lebanese town of Kfar Kila near the border with Israel. Following morning's killing of Major General Qasem Soleimani, Lebanon's Iran-backed Hezbollah movement called for the missile strike by Israel's closest ally, to be avenged AFP via Getty US airstrike kills Iran's Qassem Soleimani: Fallout in pictures Iranian women take to the streets in Tehran EPA

“Iran’s controlled retaliation intended to avoid major casualties. He should appreciate Iran’s ultimate restraint.”

Strongly shaping the Iranian response, say experts, is a keen awareness of Trump’s domestic troubles as well as the extremist circle of Washington insiders who have his ear. Iranian officials are well aware of widespread concerns among the American public, lawmakers and foreign policy professionals about Trump’s “maximum pressure” campaign against Iran, which was conceived by a handful of Washington ideologues.

An Ipsos/Reuters poll this week showed 54 per cent of Americans disapprove of Trump’s Iran policy, with only 37 per cent approving it.

President Rouhani, in a speech hours after the Iranian airstrikes, suggested Trump killed Soleimani to divert attention from his domestic woes, voicing solidarity with those Americans opposed to the president.

“It is possible that this action was because of the internal issues and complications in the US and the White House, which will yield opposite results with the awareness of the American people and the public opinions of the world,” he said.

Hassan Nasrallah, secretary general of the Iranian-aligned Lebanese armed group Hezbollah, cautioned supporters and loyalists in the aftermath of Soleimani’s 3 January killing that US civilians in the region “should not be touched” because this would serve Trump’s agenda.

Mohsen Rezaei, former commander of Iran’s Revolutionary Guard, also emphasised the target was the American government, not its people.

“They are trying to regularly message the various constituencies and political groups in the United States for their own purposes,” Sanam Vakil, an Iran specialist at Chatham House, tells The Independent.

“They’re messaging not just to the current administration but obviously to the Democratic candidates. They’re trying to assess US politics as they plan their next steps and look at the year.”

Iranians officials frequently alienate American citizens with ritualistic antics that include chanting “Death to America” or setting fire to US flags at rallies and even on the floor of parliament. Iran may still be planning covert attacks against US interests and allies that hurt America on the whole, giving Tehran a measure of plausible deniability.

But such provocative moves are not for a lack of understanding of America, where many senior members of Hassan Rouhani’s administration spent years studying and working.

Americans have no idea who the leaders of Iran’s various political factions are. But Nancy Pelosi, Chuck Schumer and Mitch McConnell – while not exactly household names – are regularly featured and quoted in the Iranian print and broadcast media as well as the ubiquitous online messaging channels that have become the staple of the Iranian media diet.

Presidential candidates Elizabeth Warren and Bernie Sanders’ strong anti-war messages have been featured in the Iranian media, as have reports of protests against Trump in the US.

Iranians know that Trump has been impeached by the US congress, and that world-famous celebrities regularly trash him on social media. How many Americans know that Iranian lawmakers are seeking to impeach Rouhani’s ministers of oil, interior and education?

When Misha Collins, a Hollywood television actor, tweeted in Persian to disavow Trump’s threats against Iranian cultural sites, his comments were widely reported in the Persian-language media, including conservative outlets.

Trump’s polling numbers and surveys indicating public disapproval of his Iran policy are regularly reported on state media outlets. Senior Iranian leaders know Trump is in political trouble, and have been keenly listening as Democrats seeking to replace him vow to restore the nuclear deal he rubbished and resume some semblance of diplomatic ties with Iran.

“There’s a perception in Iran that the Democrats and perhaps other western countries are working to make sure Trump is not re-elected,” says Mahdi Khalil, a political analyst in Tehran. “If he’s re-elected there will definitely be a war.”

Though Iran and the US don’t have embassies in each others’ nations, Iran’s foreign ministry and embassies regularly follow events in the US through media, and other channels.

Footage purports to show Iranian missiles being fired at US bases in Iraq

Iran’s US-educated foreign minister, Mohammad Javad Zarif, became such an effective communicator during meetings with lawmakers, presidential candidates and policy specialists during his visits to the US that the Trump administration designated him as a terrorist last year, and recently banned him from a UN meeting in violation of the organisation’s 1947 charter.

“Iranians do very much care about US domestic politics,” says Vakil. “They know they have supporters and interlocutors ready to translate their signals to the Democrats, to the opposition.”

Through the media and through intermediaries, Iranians have also been seeking to sway Trump to switch course. Zarif, tweeting in English, warns of US casualties in any war with Iran and regularly trashes those advising him on Middle East policy by name, saying a war with Iran will cost him re-election, just as some rightwing pundits in the US like Tucker Carlson have cautioned.