Jeremy Hunt has accused Boris Johnson of being ready to consign the UK to a “do or die” no-deal Brexit on 31 October for the sake of his own ambition to become prime minister.

After Mr Johnson repeatedly dodged the foreign secretary’s demand to know if he would resign if he failed to deliver Brexit by the Halloween deadline, Mr Hunt told him: “It’s do or die for the country, but not a prime minister who won’t put his own neck on the line. That’s not leadership… It’s not do or die, is it? It’s Boris in Number 10 that matters.”

As the pair clashed in their first head-to-head TV debate of the Conservative leadership campaign, Mr Johnson repeatedly branded his rival a “defeatist” and a “managerialist” and said that only he had the optimistic approach which would get the UK off the “hamster-wheel of doom” of ever-extending Brexit negotiations.

But Mr Hunt retorted: “We will not leave the EU just with optimism… Being prime minister is about telling people what they need to hear, not just what they want to hear. The difference between you and me is that you are peddling optimism.”

Going into the hour-long ITV debate as the underdog, and with many Tory activists’ postal ballots already believed to have been cast, Mr Hunt went on the attack from the start, blasting his opponent for a lack of attention to detail and presenting himself as a skilled negotiator who could get a Brexit deal with Brussels.

Highlighting the high-level denials of Mr Johnson’s claim that the UK could continue zero-tariff trade with the EU while negotiating a deal after Brexit under the World Trade Organisation’s Gatt 24 provisions, Mr Hunt said: “Getting details like that wrong is fine for a newspaper column but if you’re prime minister that is people’s jobs at stake.”

In a fiery exchange which left Mr Johnson bemoaning the dangers of “blue on blue” warfare, presenter Julie Etchingham intervened regularly to keep the contenders on a tight leash, demanding that they let one another speak and answer each other’s questions.

The former London mayor was left wriggling as he tried to sidestep questions over whether he would keep Sir Kim Darroch as ambassador to the US, suspend parliament to push Brexit through or cancel the third runway for Heathrow.

Hunt accused his rival of peddling optimism

Mr Hunt blasted Donald Trump for “unacceptable” comments about Theresa May in the wake of the leak of Sir Kim’s disobliging memos about the US president, and insisted that the ambassador would stay if he became PM.

By contrast, Mr Johnson said that Mr Trump – who has fired off a succession of angry tweets branding Sir Kim “wacky”, “foolish” and “pompous” – had been “dragged into a British political debate” and stressed the importance of maintaining the UK’s close partnership with the US.

He refused to say whether he would keep Sir Kim in post until his planned retirement at the end of the year, saying: “It is vital that our civil service is not politicised by ministers leaking what they say. Whoever leaked that deserves to be eviscerated.”

Asked if he would be ready to use prorogation of parliament to stop MPs blocking a no-deal Brexit, Mr Hunt replied: “When that has happened in the past, when parliament has been shut down against its will, we actually had a civil war.

“I think it would be a rather curious thing to do, if this is about taking back control for parliament, to actually shut it down.”

He challenged Mr Johnson to rule it out, but the former foreign secretary said: “I’m not going to take anything off the table, any more than I’m going to take no-deal off the table.

“I think it’s absolutely bizarre at this stage in the negotiations for the UK – yet again – to be weakening its own position.”

Boris Johnson and Jeremy Hunt clash during televised debate: 'You haven’t answered any of my questions', says Hunt

On Heathrow – where he previously promised to lay down in front of the bulldozers to stop the development of a third runway – Mr Johnson said only that he had “the gravest reservations” about the project and would be following the legal battle closely, prompting the retort from Mr Hunt: “If you are going to be prime minister, you have got to have an answer to these questions. A third runway would spread wealth around the country. We should back it.”

In a contest where the pair are competing for the votes of an estimated 160,000 Conservative members, Mr Johnson sought to win an advantage by highlighting his rival’s position as a former Remain supporter who was willing to delay Brexit beyond the end of October to get a deal.

He demanded to know how long Mr Hunt was ready to wait.

Presenting himself as the best candidate to deliver Brexit and defeat the “semi-Marxist, wealth and job destroying lunacy” of Jeremy Corbyn’s Labour, Mr Johnson said: “This country faces a momentous choice: we can either continue with the same old, failed, can-kicking approach, destroying trust in politics, sapping business confidence.

“Or else we can change, get back our mojo, restore this country’s reputation around the world and put ourselves on the path to long-term success.”

But the former health secretary responded: “In poll after poll I am the public’s preferred choice for prime minister because I appeal not just to those who already vote Conservative but those we need to win.

“And to those watching at home, I will be your prime minister, whoever you vote for, as I bring together our amazing United Kingdom.”

Conservative leadership debate: 'We’ve had a bellyful of defeatism', says Boris Johnson

Asked four times to say whether he would resign if he failed to deliver Brexit by the Halloween deadline, Mr Johnson said: “I don’t want to hold out to the EU the prospect that they encourage my resignation by refusing to agree a deal.”

Mr Hunt replied: “He said very clearly before that it was leaving on 31 October do or die. I think it would be do or die for the country but not for a prime minister who won’t put his own neck on the line. That’s not leadership.”

In a swipe at his rival, Mr Johnson said it was “totally defeatist not to set a hard deadline”.

“If we go into these negotiations from the beginning with a plan to allow that deadline yet again to be fungible, to be a papier-mache deadline, I’m afraid that the EU will not take us seriously,” he said.

Jeremy Hunt said he did not want an election before Brexit was delivered – something that Boris Johnson risked with his “do or die” commitment to 31 October.

The foreign secretary told Mr Johnson: “Being prime minister is about telling people what they need to hear, not just what they want to hear.”

The hour-long debate ended with an opportunity for each contender to pay a back-handed complement to his rival, as a member of the audience asked them to name something they admire about one another.

Mr Johnson reminded potential voters of his opponent’s past as a Remain supporter, replying: “I greatly admire his ability to change his mind and campaign for Brexit now.”

And Mr Hunt said sarcastically: “I really admire Boris’s ability to answer the question. He has this great ability, he puts a smile on your face and you forget what the question was. It’s a brilliant quality for a politician – maybe not for the prime minister though.”