Qassem Soleimani, the Iranian Quds Force commander who was killed in a US drone attack in Baghdad on Friday, was in Iraq to negotiate a de-escalation in tensions with Saudi Arabia, according to the Iraqi prime minister.

Adel Abdul Mahdi, Iraq’s caretaker prime minister, told his parliament on Sunday that President Trump called him to ask for help in mediating with Iran after the American embassy in Baghdad was attacked.

On Tuesday, people belonging to the Shiite group Kataib Hezbollah overran security and scaled the walls of the embassy. No Americans were injured during the protests.

Trump blamed Iran for the embassy incidents and threatened retaliation.

Iraq's caretaker prime minister, Adel Abdul Mahdi (left), told parliament on Sunday that he was due to meet top Iranian general Qassem Soleimani (right) on the day that he was killed in a US drone strike in Baghdad early on Friday

Abdul Mahdi said that Soleimani was due to bring him Iran's response to de-escalation proposals made in three-way talks between Tehran, Iraq, and Saudi Arabia. The above image shows the burning vehicle which was hit in the attack that killed Soleimani at Baghdad airport

The attack on the embassy on Tuesday unfolded after thousands attended the funerals of the Iran-backed Kataib Hezbollah fighters killed in the American airstrikes last Sunday.

US fighter jets bombarded three locations in Iraq on Sunday night, in retaliation for last week's 36-rocket attack which killed an American contractor and injured several others at a base in Kirkuk, 170 miles north of Baghdad.

On Sunday the US struck a total of five Kataib Hezbollah controlled weapon depots in Iraq and Syria, killing at least 25 people and wounding 51.

Abdul Mahdi said he worked hard to defuse tensions outside the embassy.

He said he went so far as to threaten to resign if the crowds did not disperse, according to Axios.

Abdul Mahdi even told Iraq's parliament that Trump thanked him for his efforts. He expressed disappointment that while the American president was grateful, he was also simultaneously planning an attack on Soleimani.

Soon after Trump made his request to Abdul Mahdi for mediation, US forces launched their drone strike on Friday killing Soleimani, the Iraqi leader was quoted as saying by National Public Radio.

Abdul Mahdi slammed the Americans on Sunday for what he called a ‘political assassination’ in targeting Soleimani.

Abdul Mahdi suggested that the Iranian military leader was in Baghdad as part of Iraqi-mediated negotiations with Iran’s main regional rival, Saudi Arabia.

He said that Soleimani was going to meet him on the same day that he was killed.

‘He came to deliver me a message from Iran, responding to the message we delivered from Saudi Arabia to Iran,’ Abdul Mahdi told The Washington Post.

The Iraqi leader did not provide any further details.

Tensions between Iran and Saudi Arabia have been high since September, when Iran was blamed for an attack on Saudi oil facilities.

The Saudis, for their part, were reportedly taken aback by the American strike against Soleimani.

Saudi Arabia was not consulted by its ally Washington over the strike, an official said Sunday, as the kingdom sought to defuse soaring regional tensions.

Saudi Arabia faces a ‘heightened risk’ of missile and drone attacks, the US warned, after Tehran vowed ‘revenge’ following the strike on Friday that killed the powerful Quds Force commander in Baghdad.

‘The kingdom of Saudi Arabia was not consulted regarding the US strike,’ a Saudi official told AFP, requesting anonymity.

‘In light of the rapid developments, the kingdom stresses the importance of exercising restraint to guard against all acts that may lead to escalation, with severe consequences,’ the official added.

Saudi Arabia on Sunday that the Trump administration did not consult with the kingdom before decided to take out Soleimani. Saudi Crown Prince Mohammed bin Salman is seen above in Riyadh on December 10

Several thousand protesters and militia fighters broke down the gate of the US embassy in Baghdad on Tuesday, storming the compound as gunshots and sirens ring out, following US air strikes on Hezbollah that killed 25 last Sunday

Saudi Arabia's foreign ministry made a similar call for restraint at the weekend and King Salman emphasized the need for measures to defuse tensions in a phone call on Saturday with Iraqi President Barham Saleh.

In a separate phone call with Iraq's caretaker premier Adel Abdel Mahdi, Saudi Crown Prince Mohammed bin Salman stressed ‘the need to make efforts to calm the situation and de-escalate tensions,’ the official Saudi Press Agency reported.

The crown prince has instructed Prince Khalid bin Salman, his younger brother and deputy defense minister, to travel to Washington and London in the next few days to urge restraint, the pan-Arab Asharq al-Awsat newspaper reported.

Prince Khalid will meet White House and US defense officials, the paper said, citing unnamed sources.

The killing of Soleimani, seen as the second most powerful man in Iran, is the most dramatic escalation yet in spiraling tensions between Washington and Tehran and has prompted fears of a major conflagration in the Middle East.

President Donald Trump, who ordered the drone strike, has warned that Washington will hit Iran ‘very fast and very hard’ if the Islamic republic attacks American personnel or assets.

Saudi Arabia and the United Arab Emirates, both allies of Washington, are also vulnerable to Iranian counter strikes.

Abdul Mahdi claims that President Trump (seen left returning to the White House with First Lady Melania Trump on Sunday) personally called him and asked him to mediate talks with Iran

The American embassy in Riyadh on Sunday warned its citizens there was a ‘heightened risk of missile and drone attacks’ close to military bases and energy facilities, particularly in the kingdom's oil-rich Eastern Province and areas near the Yemen border.

A string of attacks blamed on Iran has caused anxiety in recent months, as Riyadh and Washington deliberated over how to react.

In particular, devastating strikes against Saudi oil installations last September led Riyadh and Abu Dhabi to adopt a more conciliatory approach aimed at avoiding confrontation with Tehran.

Analysts warn that pro-Iran groups have the capacity to carry out attacks on US bases in Gulf states as well as against shipping in the Strait of Hormuz - the strategic waterway that Tehran could close at will.

‘Expect Iranian reprisals (directly or through partner groups in Iraq, Lebanon or elsewhere) to target US partners in the region including Saudi Arabia,’ said Thomas Juneau, an assistant professor at the University of Ottawa.

‘Given the climate in the US, where support for Saudi in the media and Congress is at an all time low, it will be difficult for Trump to commit significant resources to come to its aid.’

Yemen's pro-Iran Houthi rebels, locked in a five-year conflict with a Saudi-led military coalition, have also called for swift reprisals for Soleimani's killing.

‘The aggression... will not go without a response,’ said Houthi political council member Mohammed Al-Bukhaiti.

"How the response is going to be, when and where will be determined by Iraq and Iran, and we will stand with them as a hub for the resistance."

In September, the Abqaiq oil processing facility (pictured on fire) and Khurais oil field in Saudi Arabia were both rocked by explosions which cut off 5 per cent of the world's supplies. Saudi authorities blamed Iran for the strike

It was unclear if the Houthi warning was directed in part at Saudi Arabia, which has stepped up efforts to end Yemen's conflict amid a lull in Houthi attacks on the kingdom.

Saudi military commanders recently met with counterparts from ‘friendly countries’ to formulate a new strategy to tackle the Yemeni rebels, particularly those ‘opposing’ a political solution, according to Asharq al-Awsat.

Riyadh has said it will host a separate meeting of foreign ministers of Arab and African coastal states on Monday.

Meanwhile, Iraq's parliament voted on Sunday to expel US troops from their country while the leader of Lebanon's Hezbollah group said the US military across the region 'will pay the price' for killing Soleimani.

Iraq's parliament voted in favor of a nonbinding resolution calling for the expulsion of American soldiers from their country in a move that that could pave the way for a resurgence of the Islamic State group.

The resolution asks the Iraqi government to end the agreement under which Washington sent forces more than four years ago to help fight the IS extremists.

The bill is subject to approval by the Iraqi government but has the backing of the outgoing prime minister.