President Donald Trump’s Defense Department ordered the killing of top Iranian General Qasem Soleimani this week, sparking both celebration and widespread fear of another Middle East war.

During the presidency of Barack Obama, Trump warned against striking on Iran, repeatedly predicting that Obama would attack the nation to help him get reelected.

Trump’s first warnings about attacking Iran came in 2011, when he tweeted things like, “@BarackObama will attack Iran in the not too distant future because it will help him win the election” and “@BarackObama will attack Iran,” linking to a now-private YouTube video.

@BarackObama will attack Iran in the not too distant future because it will help him win the election. If the… (cont) http://t.co/WEJd30pR — Donald J. Trump (@realDonaldTrump) November 14, 2011

In 2012, Trump warned several times that Obama may use an attack on Iran to win reelection. (RELATED: ‘The Anti-Benghazi’: Trump Tweets That US Embassy In Baghdad Is Safe, Says Iran Will Pay)

“@BarackObama will attack Iran in order to get re-elected,” Trump said in January.

@BarackObama will attack Iran in order to get re-elected. — Donald J. Trump (@realDonaldTrump) January 17, 2012

“Just as I predicted, @BarackObama is preparing a possible attack on Iran right before November,” he said in July.

Just as I predicted, @BarackObama is preparing a possible attack on Iran right before November. http://t.co/ISaJp1xo — Donald J. Trump (@realDonaldTrump) July 3, 2012

“I always said @BarackObama will attack Iran, in some form, prior to the election,” Trump said in August.

I always said @BarackObama will attack Iran, in some form, prior to the election. — Donald J. Trump (@realDonaldTrump) August 16, 2012

“Don’t let Obama play the Iran card in order to start a war in order to get elected–be careful Republicans!” he said again in October.

Don’t let Obama play the Iran card in order to start a war in order to get elected–be careful Republicans! — Donald J. Trump (@realDonaldTrump) October 22, 2012

Even after Obama’s reelection, Trump continued to warn about a possible attack on Iran.

“I predict that President Obama will at some point attack Iran in order to save face!”

I predict that President Obama will at some point attack Iran in order to save face! — Donald J. Trump (@realDonaldTrump) September 16, 2013

“Remember what I previously said–Obama will someday attack Iran in order to show how tough he is,” he said in September 2013.

Remember what I previously said–Obama will someday attack Iran in order to show how tough he is. — Donald J. Trump (@realDonaldTrump) September 25, 2013

In November, he followed up again, “Remember that I predicted a long time ago that President Obama will attack Iran because of his inability to negotiate properly-not skilled!” (RELATED: Behind The Growing Rift Between Russia And Iran)

Remember that I predicted a long time ago that President Obama will attack Iran because of his inability to negotiate properly-not skilled! — Donald J. Trump (@realDonaldTrump) November 11, 2013

The attack on Quds Force Gen. Soleimani was ordered Thursday.

Some Trump allies in Washington like Republican South Carolina Sen. Lindsey Graham have praised the strike, but other pro-Trump voices like Daily Caller co-founder Tucker Carlson warned about the risk of war with Iran. (RELATED: Trump Tweets American Flag After US Kills Top Iranian Military Leader)

In the immediate wake of the attacks, some Democrats also claimed that Trump is using the attack on Iran as a distraction. (RELATED: Hollywood Actress Rose McGowan Apologizes To Iran For Death Of Terrorist Soleimani)