A prominent critic of Boris Johnson has quit the Government, hitting out at the “haphazard and ramshackle” would-be prime minister.

Sir Alan Duncan resigned from the Foreign Office on the eve of the Tory leadership announcement and set out a plan for an early Commons test of Mr Johnson’s authority which could have prevented him entering Number 10.

Mr Johnson is widely expected to defeat Foreign Secretary Jeremy Hunt to become the Tory leader before replacing Theresa May as prime minister on Wednesday.

Sir Alan launched an effort to hold an emergency Commons debate on the new Tory leader – a move which could have potentially dealt him a fatal blow before he formally took office.

But he said Commons Speaker John Bercow had turned down his application for a debate after the leadership result is announced on Tuesday but before the new prime minister is appointed by the Queen at Buckingham Palace.

If it had been allowed to go ahead, MPs would have been given the chance to consider “the merits of the newly chosen leader of the Conservative Party” and – crucially – whether the Commons “supports his wish to form a government”.

Whoever wins the Tory leadership race will have to govern with a Tory-DUP majority of just two, as Charlie Elphicke had the Conservative whip suspended after being charged with sexually assaulting two women.

That majority could be further reduced to just one next week if the Tories fail to win the Brecon and Radnorshire by-election.

Sir Alan, who served in the Foreign Office under Mr Johnson, insisted his actions were not motivated by “personal animosity of any sort” about Mr Johnson but “I have very grave concerns that he flies by the seat of his pants and it’s all a bit haphazard and ramshackle”.

He said his plan could have averted a constitutional crisis if Mr Johnson goes to Buckingham Palace to be appointed prime minister but then cannot command the support of MPs.

He told the BBC that the timing of his resignation was to “try and prompt an emergency debate in the Commons ahead of Boris becoming prime minister – and it’s probably going to be him – because it’s the first time in living memory we have had a minority government change prime minister in mid-term.

“A fundamental principle of our democracy is that the prime minister is the person who can command a majority in the House of Commons and that is untested and it is in doubt.

“I thought, in order to avoid a constitutional crisis, we should test that on the Tuesday – tomorrow – before he goes to the palace on the Wednesday and the Speaker has denied me and the House that opportunity.”

In his resignation letter to the Prime Minister, Sir Alan said that Brexit had cast a “dark cloud” over the country.

He said he had “served with two very different Foreign Secretaries” – Mr Johnson and Mr Hunt.

In a veiled criticism of Mr Johnson’s record in the Foreign Office, Sir Alan said he was “deeply upset” that efforts to bring about the possible release of jailed British-Iranian woman Nazanin Zaghari-Ratcliffe were brought to such an abrupt halt.

Mr Johnson was roundly criticised for a 2017 gaffe when he incorrectly said Mrs Zaghari-Ratcliffe was teaching journalists, comments which were seized on by the authorities in Iran.

Boris Johnson
Boris Johnson leaves his office in Westminster on Monday (Kirsty O’Connor/PA)

Sir Alan’s resignation will not be the last, with Chancellor Philip Hammond and Justice Secretary David Gauke having already confirmed they will quit rather than be sacked by Mr Johnson.

Sir Alan’s move was criticised by former minister Greg Hands, who said it would make a Jeremy Corbyn-led Labour government more likely.

Mr Hands, who is backing Mr Hunt, said pre-emptive ministerial resignations “in case your own democratically-elected party leader is not to your liking are absurd”.

But Mr Hunt praised Sir Alan for his “fantastic service” adding that he had handled tricky situations “with utter professionalism and polite British determination”.

Mrs May, who was at Oxford University with Sir Alan, thanked him for his “devoted and energetic service”.

Sir Alan’s resignation came after Mr Johnson restated his firm intention to get the UK out of the European Union by the end of October, claiming a deal with Brussels could be reached if the country has the “will” and the “drive” for Brexit.

The former foreign secretary said if it was possible to get to the moon and back 50 years ago then the problem of the Irish border could be solved.

He wrote in the Daily Telegraph: “If they could use hand-knitted computer code to make a frictionless re-entry to Earth’s atmosphere in 1969, we can solve the problem of frictionless trade at the Northern Irish border.

“There is no task so simple that government cannot over-complicate if it doesn’t want to do it. And there are few tasks so complex that humanity cannot solve if we have a real sense of mission to pull them off.”

(PA Graphics)
(PA Graphics)

The ballot of Conservative Party members will close at 5pm on Monday, with the result due to be announced on Tuesday morning.

Mrs May will tender her resignation to the Queen after taking Prime Minister’s Questions in the Commons on Wednesday afternoon, with the new Tory leader set to enter Number 10 soon after.