British Prime Minister Theresa May defeated the latest attempt to challenge her flagship Brexit legislation in Parliament on Wednesday.

The lower chamber, the House of Commons, voted against amendments introduced by the House of Lords. One called for the UK to remain in the European Economic Area (EEA), which offers tariff-free access to the EU’s single market in return for accepting four key principles including free movement of people.

MPs voted against the move by 327 votes to 126. The opposition Labour Party abstained, although dozens of its MPs rebelled against the leadership: 74 voted in favour of EEA membership, while another 15 voted against. Three members of the ruling Conservatives rebelled and voted against the government and in favour of EEA membership.

The rebellions highlight the divisions over Brexit that plague both leading parties, and the lack of effective party discipline as politicians prioritise what they see as the national interest.

A potential defeat for the government on the customs union was headed off when it proposed a change of wording to the bill. However, other bills on trade and customs are due to come before the House of Commons in the next few weeks, and rebels are preparing to challenge May’s plans again.

Future trading and customs arrangements have become perhaps the most sensitive issue in the UK’s negotiations with Brussels. Many believe the government’s plans to leave the EU’s single market and customs union will be disastrous for business.

On Tuesday the government also saw off other potential rebellions earlier this week which threatened to derail its Brexit plans. It agreed to work towards a “customs arrangement” with the EU in a compromise move, and gave a concession to rebels on a vote to give Parliament a “meaningful vote” on a Brexit deal.