The House of Commons votes by 315 to 274 to back an amendment designed to block Boris Johnson from pursuing a no-deal Brexit in October.

Digital Minister Margot James resigns in order to back the vote.

Johnson has insisted he will take the UK out of the EU on October 31 "do or die."

One plan he has refused to rule out, would be to suspend parliament in the run-up to the UK's exit in order to prevent MPs from blocking a no-deal departure.

However, the amendment to the Northern Ireland Bill will force MPs to sit in the days running up to the end of October, effectively blocking the next prime minister from suspending parliment.

The House of Commons has voted to prevent Boris Johnson from pursuing a no-deal Brexit in October, after it passed an amendment designed to block him from suspending parliament in order to force Britain out of the European Union in October.

One Conservative minister resigned to vote for the amendment, with several more abstaining, in a bid to block a no-deal exit.

Johnson, who is the strong favourite to replace Theresa May as prime minister next week, has insisted that he will take the United Kingdom out of the EU "do or die" — with or without a deal — on the scheduled exit date of October 31.

Johnson has also repeatedly refused to rule out suspending parliament in order to force through a no-deal Brexit.

The favourite to replace May was reportedly considering a plan to hold a Queen's Speech in November, which would shut down the House of Commons while the UK left the EU, and prevent MPs from being able to act.

However, MPs on Thursday afternoon voted by 315 to 274 to back an amendment to the Northern Ireland Bill, which is designed to force parliament to remain open in the days and weeks running up to October 31.

The amendment, brought by Conservative MP Alistair Burt and Labour MP Hilary Benn, obliges MPs to sit on certain dates in October, effectively making it impossible for the next prime minister to suepend parliament during that time.

A number of government ministers who oppose a no-deal Brexit also rebelled against the government to abstain on the vote.

Chancellor Philip Hammond, Business Secretary Greg Clark, Justice Secretary David Gauke, and International Development Secretary Rory Stewart all failed to vote with the government.

Margot James resigned as a junior culture minister in order to vote for the amendment.

Speaking to BBC Newsnight, James predicted that more rebels will emerge if and when Boris Johnson becomes prime minister.

"If we do end up with Boris as our PM then I think quite a number of people who would have always been voting with the government will leave and will be doing everything they can with myself and others to make sure we leave with a deal, or carry on negotiating, or we look for another outcome," she said.

Business Secretary Greg Clark, who abstained on the vote, told the BBC: "I couldn't support the idea we allow the doors of Parliament to be locked at this crucially important time."

He added: "That would be a constitutional outrage."

A total of 17 Conservative MPs defied their government to vote for the amendment, including former ministers Richard Harrington, Justine Greening, and Sam Gyimah.

A spokesperson for the Prime Minister Theresa May indicated that no minister who didn't vote with the government would be sacked.

"The Prime Minister is obviously disappointed that a number of Ministers failed to vote in this afternoon's division. No doubt her successor will take this into account when forming their government," they said.

Those backing the amendment believe that time is running out to prevent a no-deal Brexit.

One former Conservative minister, who backed the amendment, told Business Insider that his colleagues felt they had "to stand up and be counted."

"There are not many opportunities in terms of time and mechanisms. If anything, it is too little too late," they told Business Insider.

They added that defeating the government on Thursday would be a "show of strength" that could deter Johnson from pursuing no-deal.

"If he doesn't feel he can get away with it, he won't go for it... You can change the way he calculates his options by showing strength," the former minister said.

Anti-Brexit MPs welcomed the result.

Tom Brake, the Liberal Democrats' Brexit spokesperson, said the vote was "a milestone victory in blocking Boris from trampling on our democracy" and made it "potentially illegal for a Boris Johnson administration to prorogue Parliament in the run up to October 31st."

Labour MP and Best for Britain campaign supporter David Lammy said: "MPs from across the House, and with differing views on Brexit, have come together to stand up for the sovereignty of the British Parliament.

"Parliament must never bow down to attempts to silence its voice. Any effort to shut it down to force through a no-deal Brexit is a direct attack on our Parliamentary democracy. We will continue to resist as we have here."

Parliament goes into recess at the end of next week — when either Johnson or his leadership rival Jeremy Hunt will have been announced as the next prime minister.

It does not return until September, at which point the October 31 Brexit deadline will be fast approaching. MPs will also take a break in the second half of September to attend political party conferences.