A former minister has sensationally revealed he quit the government in order to table an emergency motion in parliament which could have blocked Boris Johnson from becoming prime minister.

Sir Alan Duncan's plan exposes the depth of rifts within the Conservative Party over the expected elevation to 10 Downing Street of the Brexit figurehead who has vowed to take the UK out of the EU in October, deal or no deal.

It came as international development secretary Rory Stewart confirmed he will join chancellor Philip Hammond and justice secretary David Gauke in stepping down from government when Theresa May steps down as PM on Wednesday. Other ministers are expected to follow them if Mr Johnson wins the race to succeed Ms May as Conservative leader on Tuesday.

Announcing his resignation from the Foreign Office on the eve of Tuesday's announcement of the new Tory leader, Sir Alan made clear that he was not willing to serve under a man who he branded a "circus act" for his record as foreign secretary.

And he told the BBC that he had attempted to table a motion for debate on Wednesday to test whether Mr Johnson could command a majority in the Commons before he takes up the position of prime minister.

The motion - which would have been debated immediately after Theresa May's final session of prime minister's questions and before the handover of power to her successor - stated: "This House has considered the merits of the newly-chosen leader of the Conservative Party and supports his wish to form a government".

Tabled under a mechanism known as SO24, it would not amount to a confidence motion. But defeat before he has even entered 10 Downing Street would have been a potentially fatal blow for Mr Johnson in his efforts to take power.

In order for a would-be premier to be appointed prime minister, the Queen must be advised - usually by the outgoing PM - that he is capable of commanding a majority in the Commons. If this had been definitively proved not to be the case, Her Majesty might have had to summon another candidate to attempt to do so.

However, it is understood that Speaker John Bercow rejected the motion. His office declined to confirm that any debate had been requested.

Duncan said: "We are in a difficult constitutional moment, because this is the first time in living memory that a prime minister has changed midterm when there is only a minority government.

"The fundamental principle of our parliamentary democracy is that the prime minister is the person who can command a majority in parliament. That probably should be tested.

"So rather than have a constitutional crisis on Thursday or in early September, I thought it would be sensible to test this before the new prime minister goes to the Palace.

"Unfortunately, the Speaker declined to let me do that."

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".

Foreign secretary Jeremy Hunt said Duncan would be "greatly missed" in the department, but hinted at a swift return to government for Sir Alan if he wins the race to succeed Ms May, telling MPs his absence would be "not for long, if the results go the way I am hoping".