LONDON (Reuters) - Prime Minister Theresa May’s Brexit plans were rejected by parliament’s upper chamber on Monday, setting up a confrontation with pro-EU MPs later this week which will test her ability to lead a minority government.

Britain's Prime Minister Theresa May leaves 10 Downing Street in London, June 13, 2018. REUTERS/Toby Melville

Ministers are seeking approval for the final wording of the legislation that will end Britain’s membership of the European Union - the legal cornerstone of May’s plan to withdraw from the bloc in March next year.

However, the government has fallen into a row with MPs in May’s own party who think parliament should have a greater say in the exit process than ministers want to give it.

The outcome of that row, playing out in the intricate process of passing different proposals between parliament’s two chambers over the coming days, will define May’s ability to face down rebels who want a softer version of Brexit.

The latest confrontation took place in the unelected House of Lords, which on Monday voted 354 to 235 in favour of a plan that would allow parliament to shape the government’s next steps in the event that MPs reject the deal May negotiates with Brussels, or if she fails to negotiate one at all.

In voting for that plan, the upper chamber rejected a proposal put forward by May’s government to give parliament a symbolic vote on next steps, but which stopped short of giving MPs the power to force ministers to change course.

Ministers say they are confident of getting a divorce deal that parliament will accept, and that all discussion of the vote is hypothetical. Nevertheless, they insist parliament cannot be allowed to overturn Brexit or tie the government’s hand is negotiations.

May’s Conservative Party does not have a majority in the Lords, and was expected to lose after compromise talks with rebel MPs broke down last week.

The proposal passed on Monday will now be voted upon in the lower House of Commons on Wednesday, with the pro-EU camp still seeking compromise but warning they could collapse the government unless their demands are met.

After an ill-judged election last year, May relies on the help of a deal with a small Northern Irish party to win votes in the Commons and can afford to lose no more than a handful of Conservative rebels if she is to avoid an embarrassing defeat.

Wednesday’s votes will be crucial for May’s attempts to resist a ‘meaningful vote’ plan that is seen as a step towards a softer Brexit - an outcome that would mean closer ties to the EU on issues such as customs and regulations.

Failure to keep her party in line would also signal trouble for several other contentious pieces of legislation needed to prepare for Brexit, including on central issues such as trade and customs policy.