As President Trump’s allies rushed to defend his decision to authorize a drone strike that killed Iran’s top military commander, many have focused less on Qasem Soleimani than another once-prominent actor in Middle East affairs: former president Barack Obama.

“Obama drew red lines & ignored them,” Rep. Matt Gaetz (R-Fla.) wrote in a tweet, adding that Trump “never will.”

“There is a NEW Sheriff in town,” proclaimed former Milwaukee sheriff David A. Clarke Jr., a vocal Trump surrogate. “Maybe they thought Obama was still the Commander in Chief.”

House Minority Whip Steve Scalise (R-La.) recycled a misleading claim that Obama had been “sending Iran pallets of cash as they killed Americans.” But with Trump in charge, he added, “America fights back.”

For Trump, the true measure of the dramatic and risky military operation will become clear over time, as the United States braces for a potential retaliatory strike from Iran that could embroil his administration in the kind of complex and intractable Middle East conflict he had pledged to avoid. But amid the immediate fallout from Soleimani’s death, the president and his defenders rushed to declare that Trump had bested his predecessor in standing up to a malign foreign power.

To Trump’s allies, the killing of Soleimani didn’t just eliminate Iran’s chief military strategist, it was a “bigger deal than Osama bin Laden,” according to Ryan Fournier, co-chairman of Students for Trump. The al-Qaeda mastermind of the Sept. 11, 2001, attacks was killed in a Navy SEAL raid in 2011 — one of Obama’s top national security accomplishments.

The boastful tone aimed to grant Trump a measure of validation and credit at a time of enormous political vulnerability amid an ongoing impeachment proceeding. But it also served to rebut criticism over Trump’s move in 2018 to abandon the Iran nuclear deal that the Obama administration negotiated three years earlier. The decision fulfilled a chief Trump campaign promise but exacerbated tensions between Washington and Tehran and, experts said, helped lead to the escalating crisis punctuated by the drone strike on Soleimani.

Trump, former aides said, has burned with a desire to erase Obama’s foreign policy legacy and prove himself a superior commander in chief.

“For whatever reason, President Trump has fixated on President Obama, and I think that he views President Obama as the metric he has to beat,” said Fernando Cutz, who served on the National Security Council under both presidents, including a stint as senior adviser to H.R. McMaster, Trump’s second national security adviser.

McMaster and other top aides, including former secretary of state Rex Tillerson, had strenuously lobbied Trump to stay in the deal that imposed limits on Iran’s program to build a nuclear weapon in exchange for economic sanctions relief. But that effort ultimately failed and, Cutz said, and helped cost McMaster his White House job.

Trump moved to nullify the deal because it “was a campaign promise and an Obama deal — every time he extended an Obama deal, he was inherently admitting it was a good deal. His whole thing was that it was a horrible deal,” Cutz said. He added that in meetings with his national security advisers, Trump groused that he should be awarded a Nobel Peace Prize and complained that Obama received one for campaigning against nuclear weapons before taking office.

After news of Soleimani’s death emerged late Thursday, Trump allies took to social media to debate with Obama administration veterans, who pronounced the drone strike a reckless and ill-advised act of war that would almost certainly backfire.

Ben Rhodes, Obama’s former deputy national security adviser for strategic communications, questioned Trump’s ability to handle a “complex, enduring, international crisis,” prompting conservative pundit Ben Shapiro to mock Rhodes as “a failed novelist who openly lied to the American people while pushing bribery of a terrorist regime to handle this.” It was a reference to a 2016 profile of Rhodes in the New York Times Magazine in which he boasted of using inexperienced reporters to shape a “narrative” and create a favorable public impression around the Iran deal.

The Trump campaign retweeted a post from Michael Joyce, a Republican National Committee spokesman, juxtaposing an image of Iranian officials mourning Soleimani’s death with one of U.S. sailors aboard a Navy command boat captured by Iran’s Islamic Revolutionary Guard Corps after entering Iranian waters in 2016.

“US-Iran relations under Obama vs. US-Iran relations under @realDonaldTrump,” Joyce wrote.

“I don’t think it’s too much of a stretch to say the root of much of this is Obama envy,” said Ned Price, a former CIA officer who served as an NSC spokesman under Obama. “It was Trump’s determination, honed over a year on the campaign trail and the first 1½ years of his administration, to rail against the Iran deal, Obama’s deal, the ‘worst deal ever.’ He got raucous applause and cheers from his base when he associated it with Obama, and that was a decisive factor in Trump’s decision to abandon it in 2018.”

It wasn’t just the Iran deal that Trump jettisoned. His administration has begun withdrawing the United States from the Paris climate accord; scrapped Obama’s agreement to enter a trans-Pacific trade pact; reversed efforts to warm relations with Cuba and dropped Obama’s “strategic patience” strategy to isolate North Korea, instead engaging directly with leader Kim Jong Un.

Trump did not mention Obama in brief remarks about the Soleimani operation Friday. But days earlier — as an Iraqi militia aligned with the Iranian general breached security at the heavily fortified U.S. Embassy in Baghdad in protest of an American strike on the group’s facilities in Syria and Iraq — Trump made a clear reference to his predecessor by threatening Iran over the incident and declaring the situation the “Anti-Benghazi” on Twitter.

He was alluding to a siege on a U.S. diplomatic compound in Libya in 2012 in which two Americans, including Ambassador Christopher Stephens, were killed — a tragedy for which Republicans faulted Obama’s administration for not securing the facility and for a muddied public accounting of what happened.

Robert Spalding, a retired Air Force general who served on Trump’s NSC, discounted the notion that the president’s actions this week were motivated by a sense of grievance over Obama’s legacy. Spalding called Soleimani a longtime threat to U.S. national security who should have been targeted by Obama and his predecessor, George W. Bush.

“Those who want to tie it to a broader agenda over differences with Obama’s policies I think is a stretch,” he said.

But Trump’s intensive focus on Obama was apparent long before he launched his White House campaign in 2015. Trump was a leading proponent of the racist “birther” conspiracy theory, which falsely accused Obama of being an illegitimate president who was born outside the United States.

In April 2011, on the night Obama authorized the raid that killed bin Laden, Trump was the target of numerous jokes by Obama at the White House correspondents’ dinner in Washington.

Trump has also falsely accused Obama of ordering his administration to wiretap the phones at Trump Tower during his campaign and transition in an effort to tie him to a Russian interference operation in the 2016 election.

Trump’s fixation with Obama has grown more acute over his three years in office. The president mentioned Obama 537 times in the first 10 months of 2019 — a 36 percent increase from the same period in 2018 and up 169 percent from that time frame in 2017, according to an analysis from Daniel Dale, a CNN analyst and fact-checker.

Some past presidents have been disdainful of their predecessors, said Rice University historian Douglas Brinkley. He cited Franklin D. Roosevelt’s temporary name change for the Herbert Hoover Dam in Nevada back to Boulder Dam and Ronald Reagan’s removal of solar panels installed at the White House by Jimmy Carter.

But there has been nothing comparable to Trump’s relentless trashing of Obama, Brinkley said.

“Trump likes the fact that attacking Obama, as an African American president, helped him with the right wing of the Republican Party that he needed,” he said.

After Trump’s embrace of the birther conspiracy theory, Brink­ley added, “he needs to show Obama was a really bad president with socialist tendencies to kind of justify his attacks on him. The wiretapping — he fabricates things Obama did to turn him into an all-purpose nemesis. There’s been belittling of a predecessor before — but not this sense of a mass destruction of a reputation.”