One remarkable feature of the Brexit debate is the sense of resignation with which the losers accepted defeat. The rooted constitutionalism of the English – and the same is true of the Scots – is so far taken for granted that we think of it as a genetic trait rather than the product of fortunate historical circumstance.

In Northern Ireland, where I grew up, habits of constitutionalism were weak. Mass protest and violent confrontation were part of the political culture, and substantial minorities on both sides supported or tolerated paramilitary shootings and bombings. The Irish border passed my hometown, a few miles to the west, and looped southwards. The militarised villages and farmlands of south Armagh were close by, where IRA teams built the bombs designed for Bishopsgate and Canary Wharf, and the last British soldier to die during the Troubles, Lance Bombardier Stephen Restorick, was shot by a sniper, just a year before the Good Friday Agreement. That irregular, porous, 300-mile line, with its rich traditions of smuggling, sectarianism and armed insurgency, is now set to become the border between the UK and the European Union.

Northern Ireland was never regarded as legitimate by all of its citizens. The state, founded in 1921, contained two distinct communities with mutually conflicting interpretations of what democracy meant, each of which had perfectly rational reasons for fearing the dominance of the other.

The fault line between unionists and nationalists is still the basic fact of the Northern Irish situation, but the EU referendum in Northern Ireland was not simply another sectarian headcount. As elsewhere, the assumption was that the UK would remain. Unionists therefore felt no pressure to choose between being British and being European.

That Ireland can be both one unit and two separate ones has enabled former enemies to live in peace

It is true that those constituencies where Brexit triumphed – seven out of 18 – were unionist strongholds. The message that European bureaucracy, immigrants and cosmopolitanism all pose a threat to British values resonated strongly there. And it is true that nationalist areas, like west Belfast and Derry, voted overwhelmingly to stay. But precisely because the referendum was not a border poll, it also expressed many of the wider social, cultural and generational divisions found in England and Wales. The 56% majority for remain contained many liberal unionists who felt the EU offered them economic security, political stability or broader cultural horizons.

Theresa Villiers, then Northern Ireland secretary, was correct to say that the conditions for a border poll, as envisaged by the Good Friday agreement, do not exist. But that doesn’t mean the peace process is safe. During the 1990s the EU provided a stage on which Irish and British politicians met as equals. The wider context of European integration also took much of the heat out of the border issue. It made the idea of a region whose inhabitants had the right to be “Irish, British, or both” easier to imagine.

A significant proportion of the €1.5bn (£1.3bn) of the EU’s Northern Ireland peace programme went to border communities and helped to ensure that both nationalists and unionists felt they benefited. Indeed the cross-border bodies set up under the agreement have been one of its least controversial areas. It has become unthinkable for the inhabitants of Derry or Newry that they should once again be cut off from their natural hinterlands in the Irish republic.

In addition to a complex network of political institutions, the Good Friday agreement formulated a knotty political doctrine. Irish nationalists believed the proper unit of decision-making was the island of Ireland, and the Irish people had therefore been denied their right of self-determination since partition. Ulster Unionists insisted that the constitutional future of Northern Ireland must be decided only by the people of its six counties. The agreement presented a superbly Jesuitical solution: it was “for the people of the island of Ireland alone, by agreement between the two parts respectively and without external impediment, to exercise their right of self-determination”.

So Ireland was a single, self-determining unit – and without explicit recognition of that principle the IRA and Sinn Féin could not have been persuaded to accept the agreement – but it took the form of two distinct jurisdictions. In May 1998 the Belfast agreement achieved overwhelming support in two simultaneous referendums north and south of the border.

There is nothing in the agreement to stop the British government taking Northern Ireland out of the EU. Ireland’s right of self-determination applies to one question only – whether Ireland should become united. But Brexit undermines the spirit of Good Friday in several ways.

The Guardian view on the Act of Union: time to reimagine the UK | Editorial Read more

First, the agreement clearly envisaged that Northern Ireland’s future constitutional arrangements would be worked out in the context of continuing partnership between the north and the south, and between politicians in London and Dublin. To remove Northern Ireland from Europe without its consent is not only morally wrong and politically risky; it is also a rejection of the fundamental bilateralism of the peace process.

Second, the all-Ireland dimension of the Belfast agreement was fundamental to securing the support of nationalists. It established the conditions within which the republic felt able to revise its constitution, recognising fully the legitimacy of partition for the first time. That Ireland can be both one unit and two separate units may be a bizarre political fiction, but it is a fiction that has enabled former enemies to live with one another in relative peace. The creation of a hard border along a line that has been invisible for many years is at odds with the full recognition of nationalist aspirations enshrined in the settlement.

The irony of this predicament is that it comes so soon after the ghosts of Irish history were apparently laid to rest. The centenary of the 1916 rising produced plenty of self-congratulation, hagiography and commercial opportunism. But above all the Easter commemorations were characterised by maturity and inclusivity. What made this possible, of course, was confidence that there had been honourable compromise in the north, and the republic was at last free to focus on its own future.

England’s unilateral declaration of independence means that the border will dominate politics again, in Dublin as well as Belfast. In addressing this problem, we can only hope politicians there will demonstrate more responsibility than their counterparts in London.