Philip Hammond has confirmed he will resign as chancellor if Boris Johnson becomes prime minister next week, as the scale of opposition to a no-deal Brexit among some ministers became increasingly plain.

Shortly before the chancellor made his announcement, live on BBC One’s The Andrew Marr Show, the justice secretary, David Gauke, made the same pledge to a newspaper. Tobias Ellwood, the defence minister, also warned that leaving the EU without a deal was not the answer.

Hammond and Gauke were among a number of ministers who defied government whips last week to abstain on a backbench motion that would make it much harder for Johnson to suspend parliament and thus stop MPs from blocking no deal.

What’s in Boris Johnson’s in-tray if he makes it to No 10? Read more

Asked by Marr if he expected to be sacked soon, Hammond said: “No, I’m sure I’m not going to be sacked because I’m going to resign before we get to that point. Assuming that Boris Johnson becomes the next prime minister, I understand that his conditions for serving in his government would include accepting a no-deal exit on 31 October and that’s not something that I could ever sign up to.

“It’s very important that the prime minister is able to have a chancellor who is closely aligned with him in terms of policy and I therefore intend to resign to Theresa May before she goes to the palace to tender her own resignation on Wednesday.”

Conceding that such an announcement on live TV was “a first”, Hammond said he would still be on the frontbench for May’s last outing at prime minister’s questions on Wednesday. “I intend to resign after prime minister’s questions, before the prime minister goes to the palace,” he said.

Asked if he would also resign if Jeremy Hunt won, Hammond said: “That might be more complicated, because Jeremy’s position is more nuanced, and I haven’t heard him express clearly a requirement for a sort of loyalty pledge around a 31 October no-deal exit.”

Q&A What does 'prorogue parliament' mean? Show Hide Prorogation is the official term that marks the end of a parliamentary session. After being advised to do so by the prime minister, the Queen formally prorogues parliament. This takes the form of an announcement in the House of Lords on the Queen’s behalf. It is a speech, written by the government, which usually describes the bills that have been passed during that session and summarises what has been achieved. It means that all work on existing legislation stops, and MPs and Lords stop sitting. Prorogation also automatically kills any bills, early day motions or questions to ministers going through parliament. Parliament can then be reopened a few days later with a fresh slate of legislation intentions, set out in a new Queen’s speech at the formal state opening of parliament.

Hammond denied he would be a focus of continued rebellion against Johnson, saying his only aim would be to stop a Johnson government forcing through no deal without the explicit consent of MPs, for example by proroguing parliament.

“This is a parliamentary democracy, and if the new prime minister can persuade parliament to vote for a no-deal exit then I will have to accept that,” Hammond said. “But we can’t have wheezes like suspending parliament or proroguing parliament in order to deny parliament its voice.”

Other than no deal, Hammond said, he held no particular issue with Johnson: “It’s nothing personal. I’ve always got on very well with Boris. I find him a very engaging character and actually, beyond the Brexit question, I don’t have have major policy disagreements with him.”

He declined to say whether he might support a vote of no confidence against a Johnson government to block leaving without a deal, saying only: “I don’t think it will get to that.”

Hammond said: “I am confident that parliament does have a way of preventing a no-deal exit on 31 October without parliamentary consent and I intend to work with others to ensure parliament uses its power to make sure that the new government can’t do that.”

Earlier, Gauke told the Sunday Times he would not be able to serve under Johnson if he pursued a no-deal Brexit: “Given that I’ve been in the cabinet since Theresa May came to power, I think the appropriate thing is for me to resign.”

He added: “If the test of loyalty to stay in the cabinet is a commitment to support no deal on 31 October – which, to be fair to him, Boris has consistently said – then that’s not something I’m prepared to sign up to.”

Speaking on Sky’s Sophie Ridge on Sunday programme, Ellwood did not specify whether he would refuse to serve under Johnson, but made plain his opposition to no deal, calling focus on it a distraction.

“The fact that we keep talking about no deal fuels the small caucus of people that see that as their destination,” Ellwood said.

“No deal is not a destination. If you run away from the EU and say, ‘Fine, we don’t want to have a deal’, you’ll still have to crawl back, moments later, to say, ‘How is our financial services going to operate? How are operations with police going to work? How are citizens’ rights going to work?’ How will they respond when we’ve just run the other way and then come crawling back to the table.”

The announcement of which of Johnson or Hunt has won the vote of Tory members to succeed Theresa May will come on Tuesday, with the successful candidate – overwhelmingly expected to be Johnson – formally taking over the next afternoon.