Donald Trump has been accused of hypocrisy for ordering the potentially inflammatory killing of a top Iranian general, after a series of tweets emerged from 2011 of him saying former president Barack Obama would start a war with Iran in order to get re-elected.

The killing of Qassem Soleimani, Tehran’s top military commander in Iraq, has sparked warnings from former diplomats and the international community, and is being described as the biggest escalation of tensions in the region for years.

Mr Trump ordered the airstrike near Baghdad Airport that killed Soleimani, as well as Abu Mahdi al-Muhandis, the senior commander of a major Iraqi militia, on Thursday.

Soleimani was one of the most powerful figures in Iran, enjoying a close relationship with supreme leader Ali Khamenei, and Iranian leaders have vowed to retaliate against the US as a result of his killing.

Between 2011 and 2015, Mr Trump tweeted multiple times that Mr Obama was vying to start a war with Iran because of “his inability to negotiate”.

Tensions high as Trump approves new Iran sanctions: In pictures Show all 17 1 /17 Tensions high as Trump approves new Iran sanctions: In pictures Tensions high as Trump approves new Iran sanctions: In pictures Iran claims that in this picture released by Iran state TV, their surface-to-air missile is seen as it shoots down a US surveillance drone EPA Tensions high as Trump approves new Iran sanctions: In pictures This photo shows US RQ-4A Global Hawk unmanned surveillance drone. A drone of this model was shot down by Iran on Thursday 21 June AFP/Getty Tensions high as Trump approves new Iran sanctions: In pictures An oil tanker is on fire after it was subject to a suspected attacked at the Gulf of Oman on June 13. The US has blamed Iran for the attack Reuters Tensions high as Trump approves new Iran sanctions: In pictures Iran claims that in this picture released by Iran state TV, debris from the downed US drone is seen after it was recovered from Iranian waters AFP/Getty Tensions high as Trump approves new Iran sanctions: In pictures Smoke billows from an oil tanker after it was subject to a suspected attacked at the Gulf of Oman on June 13 Reuters Tensions high as Trump approves new Iran sanctions: In pictures US President Trump holds up a signed executive order to increase sanctions on Iran on 24 June AP Tensions high as Trump approves new Iran sanctions: In pictures Iranian President Rouhani stated in a televised address that the White House is "afflicted by mental retardation" following the increase in sanctions on 25 June EPA Tensions high as Trump approves new Iran sanctions: In pictures An Iranian navy boat tackles the fire on the Norwegian owned Front Altair oil tanker after it was hit in a suspected attack AFP/Getty Tensions high as Trump approves new Iran sanctions: In pictures Iran claims that in this picture released by Iran state TV, debris from the downed US drone is seen after it was recovered from Iranian waters AFP/Getty Tensions high as Trump approves new Iran sanctions: In pictures Smoke billows from an oil tanker after it was subject to a suspected attacked at the Gulf of Oman on June 13 Reuters Tensions high as Trump approves new Iran sanctions: In pictures A screenshot from a video released by the US Department of Defense that the US claims to show Iranian removing an unexploded limpet mine form the hull of the Japan-owned ship that was attacked in the Gulf of Oman on June 13 Getty Tensions high as Trump approves new Iran sanctions: In pictures An item reportedly found on the Japan-owned oil tanker that was attacked on June 13 in the Gulf of Oman AFP/Getty Tensions high as Trump approves new Iran sanctions: In pictures A handout photograph from the US Department of Defense shows a composite material that the US claim was left behind on the hull of the Japan-owned oil tanker following the removal of an unexploded limpet mine Getty Tensions high as Trump approves new Iran sanctions: In pictures A view from the cabin of an Iranian navy boat as it tackles the fire on the Norwegian owned Front Altair oil tanker after it was hit in a suspected attack EPA Tensions high as Trump approves new Iran sanctions: In pictures Release by US government A picture released by U.S. Central Command shows damage to the hull of the oil tanker Kokuka Courageous. The picture suggests that the ship is 'likely' to have been hit by a mine as the US Secretary of State Mike Pompeo moves to blame Iran for the suspected attack Reuters Tensions high as Trump approves new Iran sanctions: In pictures Smoke billows from an oil tanker after it was subject to a suspected attacked at the Gulf of Oman on June 13 Reuters Tensions high as Trump approves new Iran sanctions: In pictures Release by US government A picture released by U.S. Central Command shows damage to the hull of the oil tanker Kokuka Courageous. The pictures suggests that the ship is 'likely' to have been hit by a mine as the US Secretary of State Mike Pompeo moves to blame Iran for the suspected attack EPA

He repeated his convictions in a video in 2011, saying: "Our president will start a war with Iran because he has absolutely no ability to negotiate - he's weak and ineffective.

"So the only way he figures that he's going to get re-elected, and as sure as you're sitting there, is to start a war with Iran."

In 2012, Mr Trump tweeted: “Don’t let Obama play the Iran card in order to start a war in order to get elected – be careful Republicans!”

Mr Trump’s action has drawn criticism from social media users who have called him a “hypocrite” for risking a military escalation with Iran after his repeated accusations towards Mr Obama.

One Twitter user said: “We knew [Mr Trump] would start a war to distract people from your IMPEACHMENT and here you are f***ing around with Iran.”

In July last year, Mr Trump tweeted that Iranian President Hassan Rouhani must “NEVER EVER THREATEN THE UNITED STATES AGAIN”.

He said: “YOU WILL SUFFER CONSEQUENCES THE LIKES OF WHICH FEW THROUGHOUT HISTORY HAVE EVER SUFFERED BEFORE.”

The threat came after Mr Rouhani cautioned the president against pursuing hardline policies against Tehran with the warning: “War with Iran is the mother of all wars.”

Under the Trump administration, tensions with Iran have steadily escalated since the US left the Iran nuclear deal.

The framework of the Iran nuclear deal was one of the defining foreign policy achievements of Mr Obama’s presidency. It was agreed between Iran, the EU, the US and the other four permanent members of the UN Security Council, and would have seen international economic sanctions lifted in exchange for limitations on Iran's nuclear programme.

However, the deal was vetoed by Mr Trump’s administration in 2018 and the US withdrew from the deal.

Mr Trump claimed in 2015, a year before he became president, that the nuclear deal would “lead to a nuclear arms race in the Middle East”.

Mr Rouhani has warned Tehran “will take revenge” for the death of Mr Soleimani.

“The flag of General Soleimani in defence of the country’s territorial integrity and the fight against terrorism and extremism in the region will be raised, and the path of resistance to US excesses will continue,” he said in a tweet.