
A Welsh Conservative MP has quit as a minister so he could vote against the government on its Brexit Customs Bill.
Guto Bebb resigned as minister for defence procurement ahead of Monday night's vote.
MPs voted by 305 to 302 to support an amendment that critics said would undermine Theresa May's recently-announced negotiating position.
Mr Bebb, MP for Aberconwy, has been highly critical of Brexit-supporting Conservatives recently.
He branded Boris Johnson's resignation as foreign secretary "a selfish act" and attacked former Brexit Minister David Jones for criticising the prime minister's plan for future trade with the EU.
Glyn Davies, Conservative MP for Montgomeryshire, said: "I am very upset that Guto has felt the need to resign from the government. He is a good friend and was an outstanding minister.
"Guto is a man of deep principle. He is such a talented politician that I cannot believe he will not find another important role in the future."
Leave campaigner and Monmouth Conservative MP David Davies said he was disappointed.
He added: "I'm sad to see him go, he's a friend and he was doing a really good job in the MoD. Guto is strong-minded though and in some ways I'm not surprised."
Mr Bebb was appointed minister for defence procurement in January 2018 after serving as parliamentary under secretary of state at the Wales Office and a government whip from March 2016.
He was elected MP for Aberconwy in May 2010 and voted remain in the 2016 EU referendum.
The Customs Bill amendment was tabled by Brexiteer Tories and the government's backing of it sparked a backlash from pro-EU Tory MPs, who said the PM had "capitulated".
But Downing Street, which agreed to accept the four amendments, said they were "consistent" with the White Paper where it sets out how it wants to trade with the EU in years to come.
MPs backed the amendment that prevents the UK from collecting taxes on behalf of the EU unless the rest of the EU does the same for the UK.
Applying EU tariffs to products destined for the EU is part of Mrs May's plan to avoid friction at UK borders after Brexit.
Another amendment, to ensure the UK is out of the EU's VAT regime, was backed by 303 to 300.
Analysis - Elliw Gwawr, BBC Wales parliamentary correspondent
Guto Bebb voted remain in the Brexit referendum and it was no secret he had become increasingly frustrated by the actions of some of the Brexiteers in his party.
He accused former Brexit Minister David Jones of sour grapes after he criticised the prime minister's plan for future trade with the EU.
He also attacked senior cabinet ministers for "inflammatory" and "unworthy" comments after then-Health Secretary Jeremy Hunt said threats from business over Brexit were "inappropriate".
But after a string of resignations by Brexiteers, Guto Bebb's decision to leave a job he obviously enjoyed has surprised many.
What may seem strange is that he resigned so he could vote for what was the prime minister's own position a few hours earlier.