Image copyright House of Commons Image caption Boris Johnson said he would call for a general election following the vote

A plan to stop a no-deal Brexit by taking control of the House of Commons agenda has been backed by 34 of Wales' 40 MPs.

Welsh Tory Guto Bebb, the Lib Dems' Jane Dodds and all Welsh Labour and Plaid Cymru MPs helped defeat the UK government on Tuesday night.

First Minister Mark Drakeford said the vote, which will allow MPs to introduce a new law, was "historic".

Ministers were defeated 328 votes to 301.

A total of six Welsh Conservative MPs voted against the opposition motion.

After the vote Prime Minister Boris Johnson said he would ask for a general election if MPs back the legislation - which will prevent a no-deal exit on 31 October - on Wednesday.

He said the MPs' bill would "hand control" of Brexit negotiations to the EU and bring "more dither, more delay, more confusion".

Labour's Jeremy Corbyn told him the anti-no deal law had to pass before an election was held. The support of two-thirds of MPs would be needed to allow a general election to take place.

Please upgrade your browser to view this interactive Did your MP vote in favour of allowing the government to suspend Parliament in order to secure Brexit on 30 October? Enter a postcode, or the name or constituency of your MP Seat vacant

The vote comes as hundreds of people protested in Cardiff on Tuesday evening against the planned prorogation of Parliament.

Mark Drakeford tweeted that the proposed legislation will prevent the prospect of a "destructive" no-deal Brexit.

Image caption Guto Bebb said a lack of trust in the prime minister was to blame for the result

But Brexiteer Conservative MP for Monmouth, David Davies, said the matter will not be sorted in Parliament but at the ballot box.

"No one wants to force an election on people but that's the way it's going to be resolved", he said.

Aberconwy MP Guto Bebb was the only Welsh Conservative to rebel against ministers.

Downing Street said all 21 Tory MPs who voted against the government would have the whip removed, effectively expelling them from the parliamentary party and meaning they could not stand as Conservative candidates in the election.

Mr Bebb, who is not planning to stand in the poll, told the BBC a "lack of trust" in the prime minister was the reason why many rebelled against the government.

"None of it would have happened if No 10 and the PM hadn't mishandled the issue since the decision for proroguing parliament," he said.

Earlier he said "centrists" were turning their back on the party.

Conservative Montgomeryshire MP Glyn Davies told BBC Wales events leading to his colleagues being expelled were a shock to his system and to the Tory party.

"It's very ugly. But politics is ugly. Politics isn't tiddlywinks."

Skip Twitter post by @fmwales Tonight’s historic vote paves the way for a Bill to be introduced to stop the UK Gov taking the UK out of the EU without a deal, preventing the prospect of a destructive #NoDealBrexit. — Mark Drakeford (@fmwales) September 3, 2019 Report

Labour Aberavon MP Stephen Kinnock congratulated the Conservative rebels for "standing up for their principles".

"I think this is what happens when people are bullied and intimidated - they push back. It was a good day for democracy yesterday."

Plaid Cymru's Westminster leader, Liz Saville Roberts, argued no-one in the 2016 referendum "voted for fewer jobs, lower wages and food shortages".

"No deal is simply not an option," she said.

Labour Cardiff North MP Anna McMorrin claimed the prime minister was a "national embarrassment who's fibs and bluster have been called out".

Newly-elected Lib Dem Brecon and Radnorshire MP Jane Dodds, who attended Parliament for the first time on Tuesday, said the vote was "an important step towards preventing a catastrophic no-deal scenario, which government analysis has repeatedly shown would be deeply damaging to our jobs, our economy, and our NHS".

Image caption Jane Dodds made her Parliamentary debut on Tuesday

Former Welsh Conservative assembly leader Andrew RT Davies tweeted the vote "now allows MPs to introduce a bill to delay Brexit which once again betrays democracy".

He said it also renders a planned debate in the Welsh Assembly on Thursday, called by the Welsh Government to oppose the proroguing of Parliament, "obsolete and pointless".

Mr Kinnock has backed a plan to bring Theresa May's withdrawal agreement, with changes proposed with Labour that did not come to fruition, back to the Commons.

Labour AM Alun Davies, who supports a further referendum on EU membership, called the amendment to the anti-no deal law from 17 Labour MPs "bonkers".

MPs will now vote on the Brexit delay bill. If it passes, the vote on whether to hold an election will follow.

But it looks unlikely the required two thirds of MPs will back the move for an election, given Labour's opposition.

Labour Ynys Mon MP Albert Owen, who also wants another EU referendum, said he will not be voting for an October election.

"I don't think it will resolve things. What I think we need is an extension [to the Brexit date]. What the people want is for us to resolve this matter."