The UK’s next prime minister would not back the US in a war against Iran at the present time.
Both Boris Johnson and Jeremy Hunt ruled out supporting Donald Trump’s administration should it decide to take military action in the Gulf.
Foreign Secretary Mr Hunt, who was fresh from a Brussels meeting of EU foreign ministers on how to reduce tensions with Iran, said he was “on exactly the same page” as his leadership rival on the issue.
Speaking at a debate hosted by The Sun and talkRadio on Monday evening, Mr Johnson said the focus must be on diplomatic efforts.
Asked if he would back the US on military intervention, Mr Johnson said: “I’m going to be very candid with you all tonight: if you say that going to war with Iran now represents a sensible option for us in the west, I just don’t believe it is.
“Diplomacy must be the best way forward.
“If you were to ask me whether I think should we now, if I were to be prime minister now, would I be supporting military action against Iran, then the answer is no.”
Mr Hunt said: “I’m on exactly the same page as Boris on this one.
“I don’t think they are looking to do any kind of war, I really don’t. The risk we have is something different, which is accidental war.”
Earlier, on his way into the Brussels meeting, Mr Hunt insisted that the Iran nuclear deal is not yet dead.
He said there was a “small window” of hope for preventing the international agreement aimed at stopping Tehran gaining nuclear weapons from unravelling.
He said: “We are looking to find a way to preserve the nuclear deal.
“Iran is still a good year away from developing a nuclear weapon.
“We think there is still some closing but small window to keep the deal alive, and that’s what I’m here to talk about.”
“What we are looking for is to give Iran a way out of this so that they can get back into compliance with that nuclear deal.”
Following the meeting he insisted there can be no “partial” compliance to the deal.
He tweeted: “You are either on path to a nuclearised Middle East or not…”
The comments came as the US urged European allies to take a tougher stance on Iran after Mr Trump pulled America out of the nuclear deal with Tehran.
Mr Hunt’s attendance at the EU summit came after he offered to help secure the release of the Iranian supertanker Grace 1, held in Gibraltar after being detained in an operation involving British Royal Marines.
There have been heightened tensions in the Gulf recently.
Last week, a Royal Navy warship intervened to drive off Iranian patrol boats after they approached a British tanker as it sailed through the Strait of Hormuz.
It prompted fears the Iranians were trying to seize a UK ship in retaliation for the detention of the Grace 1.
It was the latest in a series of incidents in the region, prompting fears of a slide into all-out conflict.
Meanwhile Gordon Sondland, the US ambassador to the EU, dismissed as “complete nonsense” an assessment by Sir Kim Darroch that Mr Trump decided to pull out of the Iran nuclear deal in an act of spite because it was agreed by his predecessor Barack Obama.
Sir Kim resigned as UK ambassador to Washington after his sensitive diplomatic dispatches were leaked, and Mr Sondland said Mr Trump’s approach to the Iran deal had been “very, very thoughtful”.
In recent weeks, the US has sent thousands of troops, an aircraft carrier, nuclear-capable B-52 bombers and advanced fighter jets to the Middle East.
Iran, meanwhile, has begun exceeding limits on uranium enrichment agreed in the 2015 deal amid frustration in Tehran at the return of crippling US economic sanctions.
While the Europeans say they still support the agreement, which lifted sanctions in return for Iran curbing its nuclear programme, in practice they have found it difficult to get round the US measures.