Brett McGurk is a CNN global affairs analyst who served in senior national security positions under Presidents George W. Bush, Barack Obama, Donald Trump and Joe Biden.The reviews were not kind.

On January 10, 2007, President George W. Bush announced a surge of tens of thousands of additional troops to Iraq — among the least popular decisions of his presidency. As a senior adviser, I watched from National Security Adviser Stephen Hadley’s West Wing office.

Hadley had ordered pizza, and a small group of us gathered around his television. When Bush finished speaking, Hadley began flipping through channels to gauge the reaction.

Sen. Dick Durbin was delivering the official Democratic response. “Escalation of this war is not the change the American people called for in the last election,” he declared. Sen. Barack Obama was next. He pledged to “actively oppose the president’s proposal.”

Hadley turned off the television.

“This’ll be a fight,” he said.

The next morning, traveling with Bush to Fort Benning, Georgia, I reviewed the press coverage. Republican Sen. Chuck Hagel called the surge “the most dangerous foreign policy blunder in this country since Vietnam.”

Democrats had just swept both houses of Congress in the 2006 midterm elections, an outcome Bush himself called a “thumping,” driven largely by public opposition to the Iraq War.

The message from voters seemed clear. Bush defied it.

Spc. Christopher Watson is sworn in by Gen. David Petraeus for re-enlistment at Forward Operating Base Warhorse in Bacouba, Iraq, in July 2007.

A US soldier leads a pair of Iraqi men after they were detained during a foot patrol along the Tigris River south of Baghdad in September 2007.

Over the coming months, he fired his secretary of defense; appointed new generals; a new ambassador to Iraq; and most importantly, approved a new strategy to double-down on a war that much of Washington had written off as lost.

Bush later wrote that it was among the most difficult decisions of his presidency.

The surge dramatically reduced violence and stabilized Iraq, giving it a chance to survive. Congress sought to reverse it with timetables to withdraw US forces and even cut funding from US troops. Bush vetoed such measures, and Congress lacked the votes to override him.

The politics in Washington may have changed, but Congress was not in the chain of command, and the commander in chief determined the course and conduct of an ongoing war.

Members of the Iranian security forces stand guard on April 9 under a large portrait in Tehran of Iran's new Supreme Leader Mojtaba Khamenei during a memorial to mark the 40th day since his father was killed.

Iran apparently believes that the November 3 midterm elections will determine its fortunes in the ongoing war with the US.

According to a Washington Post report published Monday, Iranian officials are escalating attacks on commercial shipping in the Strait of Hormuz to raise energy prices, punish American consumers and weaken Trump and the Republican Party before the midterm elections.

An Arab diplomat described Tehran as “obsessed” with the elections. Iranian state television has tracked Trump’s approval ratings and speculated that Republican losses will constrain the war and force concessions to Iran.

But Iran may discover that weakening an American president politically is not the same as constraining him strategically. Congress has powers over war and peace, including authority over military spending. But using those powers to force a determined president to change course is another matter.

Vessels sit on the Strait of Hormuz on June 15, as seen from Musandam, Oman.

A president can veto legislation restricting military operations, and Congress needs a two-thirds majority in both chambers to override that veto. Even if Democrats win a wave election in November, they will almost certainly lack those kind of numbers.

Legislators are also reluctant to cut off funding for American forces already in harm’s way.

Bush is but one example. Nixon escalated the war in Vietnam in 1972 even with Democrats in the majority of both houses and opposed to the war. Clinton conducted a 78-day NATO air campaign in the Balkans in 1999, even after the House refused to authorize the operation. Obama launched extended military operations in Libya in 2011 without congressional approval.

Democratic majorities in Congress would surely complicate life for Trump, bringing investigations, hearings and potentially efforts to restrict military operations. Yet Trump will remain commander in chief for another two years. And the most consequential decisions on Iran will still be made in the White House.

President Donald Trump speaks to the press outside the Oval Office of the White House on April 13.

History suggests Trump will retain a relatively free hand, leaving him three broad options:

Trump could declare the principal military objectives achieved, reduce operations and accept a costly accommodation with Iran to restore normal shipping through the Strait of Hormuz.

This may bring near-term political and economic benefits, particularly if energy prices declined.

But such an outcome could leave Iran claiming victory, having survived the American military campaign and demonstrated that it could threaten international commerce to extract concessions. Iran would also be able to invest its resources to reconstitute its nuclear and missile program, undermining the stated logic of the military campaign altogether.

If Trump intended to pull back for political reasons, he had every incentive to do so before the midterms. His decision to maintain the blockade despite the political costs makes a sudden retreat after November unlikely.

Second, he could maintain the current strategy, but with responsive strikes.

The US has blockaded Iranian ports while helping commercial vessels transit the Strait of Hormuz, increasing Gulf oil flows while imposing growing economic costs on Iran.

But the strategy has produced something close to a stalemate.

Iran can no longer close the Strait of Hormuz, but it continues threatening ships and regional infrastructure and imposing costs on those who use it.

Meanwhile, the US believes its economic blockade will soon force Iran to make concessions at the table, including on its nuclear program.

Both sides appear to believe time is on their side.

Trump could seek to break this stalemate by responding more aggressively to Iranian attacks, targeting the military infrastructure that supports them.

Adm. Brad Cooper, the commander of US military forces in the region, previewed such an approach in September, saying, “If you shoot at two of our ships, we will impose an even higher cost – taking out three of yours.”

The objective would be to impose clear expectations on Tehran, deter further attacks in the strait and calibrate military pressure to support negotiations and diplomacy.

Tehran could escalate in response, and the conflict might widen. Even so, this approach would aim to balance military pressure and diplomacy to end the war altogether.

Trump may decide that Iran is the defining foreign policy challenge of his second term and that he has a limited opportunity to reshape the Middle East before leaving office.

That could mean expanding the campaign with Israel against Iran and its regional partners, including greater support for Saudi Arabia against the Iran-backed Houthis in Yemen.

US sailors prepare ordnance on the flight deck of the USS Abraham Lincoln in support of Operation Epic Fury on February 28.

Trump might pursue a larger objective, as well: expanding the Abraham Accords through an Israeli-Saudi agreement before his presidency ends.

Such a deal was in sight shortly before Hamas’ attacks into Israel on October 7, 2023, as I describe in the first chapter of Brink, my new book on the crisis.

It is not out of the realm of the possible over the next two years, and Trump will likely do all that he can to achieve such a deal. But doing so will be extraordinarily difficult. The region has changed since October 7.

Saudi Arabia would need new security assurances from Washington. Israel would face difficult decisions on Gaza and agreeing to the “pathway to Palestinian self-determination and statehood” that’s already established in UN Security Council Resolution 2803, passed last year.

Israel’s own elections later this month may determine whether this is possible.

Still, presidents approaching the end of their terms often become more ambitious, not less.

Whatever Trump may decide, this path — a new military campaign, tied to a diplomatic achievement — will be a tempting one.

Voters fill out their ballots at a polling station in Nashua, New Hampshire, on September 8.

If I was in the White House today, I’d probably advise something in the realm of the second option: maintain economic pressure, respond more forcefully to Iranian military attacks and preserve an avenue for a negotiated settlement.

The objective should be a sustainable strategic outcome, with the means calibrated to achieve it.

If a deal with Saudi Arabia becomes possible, pursue it — but do not assume military escalation will improve the odds.

But presidents make the final decisions, not their advisers.

After the midterms, Trump may feel less constrained by politics and more determined to achieve something lasting.

Tehran might want to remember that history.

Trump has two years left. The midterms may make him weaker politically. They could also make him more determined to settle the conflict with Iran on his terms.