British Prime Minister Theresa May has won approval from the House of Commons for a law designed to create an independent customs policy after Brexit.

MPs voted 318 to 285 in favour of the customs legislation, known as the Taxation (Cross-Border Trade) Bill, which will allow the British government to levy duties on goods after leaving the European Union.

The bill must also be passed by the House of Lords to become law.

Minister Guto Bebb voted against the government, effectively quitting his frontbench role.

It comes after a day when David Davis has launched a staunch defence of Britain's Brexit negotiating hand amid bitter Tory infighting and claims the British government is "frightened" of Leave-backing MPs.

The former Brexit secretary made his first speech since resigning from the government over its white paper detailing its desired EU withdrawal plan, as ministers struggled to keep tensions in check.

Mr Davis urged MPs to back the customs bill and the Trade Bill before arguing how business can operate post-Brexit.

He bemoaned the EU for being a "slow and not very effective" negotiator of free trade agreements, as he claimed the UK has distinct advantages "over and above our economic weight" - including the English language, law and the internet.

Mr Davis's remarks came after an emotive speech from Tory former minister Anna Soubry, as she urged Tory colleagues to have a "reality check" on Brexit and how the party is conducting itself.

She also said a group of 40 "hard, no deal Brexiteers" should be "seen off" by the government.

The stormy scenes in the Commons emerged after the government said it would accept four amendments to the Bill, which allows the UK to establish a new customs regime and ensure VAT and excise laws operate as required upon Brexit, tabled by Eurosceptic Conservative backbenchers.

Ms Soubry was among those who said she could not support new clause 36 - which prevents the UK collecting tariffs on behalf of the EU unless the EU agrees to collect them from the UK - and amendment 73, which stops the UK from joining the EU's VAT regime.

Tory former attorney general Dominic Grieve labelled the two amendments as "unnecessary" and "useless", adding the only reason behind their tabling was "malevolent".

Speaking at the Bill's report stage, Tory former Cabinet minister Mr Davis said "the most difficult issue" was that of the border on the island of Ireland, adding: "There's no way however that a UK government is ever going to install a hard border in Northern Ireland."

Surrounded by Brexiteers, Mr Davis also said: "There may be 300 border crossings, but there are only six ports. So rest of world imports can actually be surveilled and controlled very straightforwardly.

"So the issue which has got much more difficult since becoming politicised, it was actually working quite well in negotiations before it became politicised is eminently soluble, soluble by technical means, soluble by co-operation between the two states."

Mr Davis told MPs that what the UK would have to give up to join a customs arrangement with the EU "is much more than is imagined".

He said: "The European Union is a slow and not very effective negotiator of free trade agreements, we keep hearing about their negotiating power, their size.

"Actually the fact that they represent 28 different countries means they come up with sub-optimal outcomes all the time and actually we're the country that does least well out of the EU free trade agreements."

He went on to tell MPs that the UK had distinct advantages "over and above our economic weight", he said: "We have the English language, we have English law, we're leaders in life sciences, artificial intelligence, Internet, medicine, a whole series of areas."

Ms Soubry was earlier told by Tory former minister Edward Leigh she "ain't no Margaret Thatcher" after she praised the former prime minister for her support of free trade.

Mr Leigh's remarks prompted shouts of "pathetic" from some Tory backbenchers.

Ms Soubry later said: "This government is in grave danger of not just losing the plot but losing a considerable amount of support from the people of this country unless we get Brexit right."

Ms Soubry went on: "Members on the frontbench and across this place should be shaking their heads with shame - this is the stuff of complete madness.

"And the only reason that the government has accepted these amendments is because it is frightened of somewhere in the region of 40 Members of Parliament - the hard, no deal Brexiteers, who should have been seen off a long time ago and should be seen off.

"These are people who do not want a responsible Brexit, they want their version of Brexit - they don't even represent the people who actually voted Leave.

"The consequences of this are grave, not just for our country but also for this party."

Tory former chancellor Ken Clarke, on the government accepting Brexiteer amendments, said: "If one week after the government has set out a policy which I'm prepared personally to give a fair wind to, I find that they are going to accept amendments like new clause 73 and new clause 36 which promptly change the policy in a quite ridiculous way I shall despair."

Mr Grieve later said he would vote against new clause 36 and amendment 73, describing them as "entirely malevolent" and "directly designed to undermine the white paper".

He told MPs: "The Government has accepted amendments which it knows cannot do what the intention is, and not only that, they've told my Honourable and Right Honourable friends that and they've decided not to say, 'Oh, then in those circumstances we withdraw the amendment', to persist with it because it's just an exercise in bullying.

"It is not my job as a Member of Parliament to put on the statute book clauses in Bills which are inadequate, incomprehensible and on top of that seek to undermine the Government and that's why I describe them as entirely malevolent and for that reason I shall be voting against both of them this evening."