WASHINGTON — President Donald Trump has had a lot to say about his thinking on the way ahead in the Iran war since Republicans were trounced in this month’s midterm elections.

In exchanges with reporters, broadcast interviews and social media posts since Election Day, he somehow has to back away from carrying out additional strikes while also backing away from the prospect of additional talks with the Islamic Republic’s negotiators on ending the 8-month-old conflict.

The president acknowledged on the day after the midterms that the war and the global economic tumult it has caused were partly to blame for Republicans’ electoral losses, while maintaining it was the right thing to do.

Then, at the start of this week, he huddled with Qatar’s prime minister at the White House and afterward told reporters that he believed it was highly unlikely he would need to order new major strikes on Iran, declaring that the war “militarily is effectively over.”

But by Thursday, he was again raising questions about whether he needed to rush to find an endgame.

He declared that the U.S. no longer needs a deal with Tehran and brusquely directed Vice President JD Vance — who served as his chief negotiator in earlier peace talks with Iran — to shift his attention to the administration’s domestic anti-fraud campaign targeting Democrat-controlled cities and states.

All the while, Trump warned Iran that the U.S. military is “locked and loaded” and keeping an eye on Pickaxe Mountain, a facility linked to Iran’s nuclear program, for signs of activity.

“If something does not work out, I would not hesitate” to act, Trump told conservative broadcaster Hugh Hewitt on Thursday.

Trump’s tonal shifts have added to the uncertainty about what comes next in a war in which America’s allies were not consulted before it was started but nonetheless struggle to deal with its economic ramifications.

“President Trump is now acting like an arsonist who has set ablaze our foreign policy,” Democratic Sen. Cory Booker of New Jersey said Friday on the sidelines of the Democrats’ postelection “What’s Next” gathering in Denver. “And now he just wants to walk away.”

The president’s ambiguous positioning on the war is expected to loom large during a visit this week to the Philippines and the Asia-Pacific Economic Cooperation meetings in the Chinese tech hub of Shenzhen.

While in Shenzhen, Trump will hold an unprecedented three-way summit with China’s Xi Jinping and Russia’s Vladimir Putin. Trump is expected to discuss Iran and the three powers’ nuclear stockpiles with Xi and Putin.

The White House declined to comment directly to queries on Trump’s postelection rhetoric on Iran. But Secretary of State Marco Rubio underscored that Trump’s approach is leading to the Iranian economy collapsing.

“The economic pain that we are inflicting on that regime is so great that there’s no need for military action because we’ve weakened them so much,” Rubio said in a Friday evening speech to the Federalist Society.

Chief mediator Qatar continues to try to negotiate an interim agreement that would restore traffic through the Strait of Hormuz, a vital passageway for the flow of oil and natural gas from the Persian Gulf to global markets, while leaving open options for further discussions between the U.S. and Iran.

But those efforts are now clouded by uncertainty after Trump’s shifting — and sometimes contradictory — comments, according to two Middle East diplomats familiar with the process.

The diplomats, who spoke on condition of anonymity because of the sensitivity of the matter, said the situation had appeared to be on the right track last week after Qatar’s prime minister met with Trump.

But Trump’s social media post Thursday declaring that the U.S. doesn’t need a deal with Iran and directing Vance “to focus his complete and total attention” on his anti-fraud campaign has created a sense of limbo.

One of the diplomats said the post raised questions about why Trump appeared to be sidelining Vance, who was skeptical about launching the war but ultimately supported Trump.

Trump’s post came as Vance had been weighing a possible reengagement with senior Iranian negotiators, according to a person familiar with the matter who was not authorized to comment publicly and spoke on the condition of anonymity.

The president posted his message calling on Vance to steer away from Iran negotiations the morning after The Wall Street Journal reported Vance was thinking about resuming talks. Trump — who had been aware of Vance’s deliberations — believed the Iranians weren’t acting in good faith, the person added.

Trump also is increasingly confident that he can credibly declare that he’s achieved his military objectives in the war.

But traversing the Strait of Hormuz remains treacherous. The United Nations reports October had the highest number of incidents against commercial ships in the contested waters since February.