BRUSSELS (Reuters) - Failure to agree a “backstop” mechanism on Northern Ireland’s land border with the European Union has thwarted hopes of a Brexit deal this week. This is what it is and why it matters:

BOTH SIDES WANT TO AVOID A “HARD BORDER” - WHAT’S THAT?

In 1998, Britain and Ireland made the Good Friday agreement to end 30 years of violence in Northern Ireland over whether it should stay British or join the Irish republic to the south. That ended controls along the 500-km (300-mile) land border and set up all-Ireland rules and institutions that make Northern Ireland special within the United Kingdom. Brexit means the north also leaving the EU, possible new checks along the border and different trade rules that could inflame tensions once more.

SO THE SOLUTION IS...?

British Prime Minister Theresa May says a special customs and trade arrangement with the EU, to be negotiated during a 20-month status-quo transition period, will ensure seamless borders between the whole of the United Kingdom and EU -- so there will be no need for intrusive checks on goods at the Irish border.

THAT SOUNDS FAIR - SO WHAT’S THE CATCH?

The Irish government, backed by the rest of the EU, wants an insurance policy in case those future trade talks fail.

AND THAT INSURANCE POLICY IS WHAT?

Early this year, EU negotiator Michel Barnier proposed that, if a better solution involving the whole UK is not found before the end of transition in 2020, Northern Ireland alone would effectively remain in the EU economic space “unless and until” there is a better solution.

BUT BRITAIN OBJECTS, RIGHT?

Yes. May and her vital allies in a pro-British Belfast party reject any trade barriers between two parts of the UK. Northern Irish unionists fear it would push the province toward a merger with the republic. Britain suggested applying a backstop customs deal to the mainland too. Brussels dismissed that as a dodge to get British goods into the single market by a back door.

SO WHAT HAPPENED AT THE WEEKEND?

EU negotiators tried to take the sting out of the backstop by stressing it might never be triggered, checks on intra-UK trade would be discreet and transition could be extended by a year to Dec. 31, 2021 to give more time to clinch an EU-UK trade deal which would keep the Irish border fully open anyway.

British negotiators insisted that a permanent EU-UK customs arrangement was the answer -- a position EU officials see as keeping the UK in the EU customs union but using a different name because May and many of her allies have ruled that out.

The EU response was that such a customs union is possible but it can only be negotiated and agreed after Brexit and in any case not in the next few weeks -- hence the EU demand that a legally binding backstop in the withdrawal treaty must remain.

Brexit Secretary Dominic Raab flew in to confirm the impasse with EU negotiator Michel Barnier on Sunday evening -- and also raised new problems that EU negotiators thought were settled.

AND WHAT HAPPENS NEXT?

May is sounding out her allies ahead of a trip to Brussels from Wednesday to Friday for summits with EU and Asian EU ministers meet in Luxembourg on Tuesday to prepare the agenda for a dinner of the other 27 EU leaders in Brussels on Wednesday. leaders. Barnier will brief them and the leaders, also taking account of any new signals from May, will take a view on how best to proceed on Brexit -- notably on whether to step up talks on future EU-UK trade and on whether to step up preparations for a “no deal”.

Further talks on future relations, intended to agree a non-binding declaration of intent to accompany the Brexit treaty, had been conditional on progress on the withdrawal agreement. Some states, notably France, are arguing that May must be put under more pressure at the summit to drop her objections.