British Prime Minister Theresa May's Brexit plans have been rejected by the UK parliament's upper chamber, setting up a confrontation with pro-EU MPs later this week which will test her ability to lead a minority government.

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 Mrs May's plan to withdraw from the bloc in March next year.

However, her government has fallen into a row with politicans in Mrs 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 Mrs May's ability to facedown rebels who want a softer version of Brexit.

The latest confrontation took place in the unelected House of Lords, which has voted 354 to 235 in favour of a plan that would allow parliament to shape the government's next steps in the event that lawmakers reject the deal Mrs 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 her government to give parliament a symbolic vote on next steps, but which stopped short of giving politicans 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.

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

The proposal passed today 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, Mrs May relies on the help of a deal with the DUP to win votes in the House of 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 Mrs 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.