LONDON (Reuters) - Britain’s upper house on Wednesday voted to give parliament the power to stop any Brexit deal that might restore a hard border across the island of Ireland, in the latest defeat for Prime Minister Theresa May’s government.

FILE PHOTO: Britain's Houses of Parliament is seen reflected in a large puddle in Westminster in London, Britain, January 3, 2018. REUTERS/Simon Dawson

The House of Lords voted 309 to 242 in favor of the amendment to the government’s key Brexit blueprint that will sever political, financial and legal ties with the EU.

Northern Ireland will be Britain’s only land frontier with the European Union after Brexit. Both sides say they are committed to keeping the border with the Irish Republic open, but finding a practical way to do that has proved elusive so far.

The issue of how the Republic and Northern Ireland will fare after Britain leaves the EU is particularly sensitive given the decades of violence in the province over whether it should be part of Britain or Ireland. Around 3,600 people were killed before the 1998 peace agreement.

There are fears that reintroducing border checks could reignite sectarian violence.

“Playing with fire is blundering into the politics of Northern Ireland with a policy that is sometimes clueless, sometimes delinquent, with a can of petrol and a box of matches,” said Chris Patten, a Conservative member of the House of Lords, who introduced the amendment.

“I don’t want to go back to the old tribes, the old humiliations, the animosities.... it would be shameful and dishonorable if this house did anything that made this more likely. I think it would be a stain on our history.”

It is the 10th time in recent weeks that the government has been defeated in the Lords on the legislation that will formally terminate Britain’s EU membership.

The Lords amendments to the European Union (Withdrawal) Bill have been criticized by the government and can be overturned in the lower house, where May has a working majority with the support of a Northern Irish unionist part, albeit a slim one.

The government’s preferred solution for Northern Ireland is for a customs agreement that allows for as much frictionless trade with the EU as possible, mitigating the need for border checks. Labour wants a formal customs union with the EU.

But the EU has rejected its proposals, saying they are too complicated and are unlikely to work.

The EU’s Brexit negotiator expressed confidence on Monday that a solution for the Irish border can be achieved if rapid progress is made by June, but said a real risk remained of Britain leaving the bloc without an overall deal.