ON OCTOBER 25th John Bruton and Bertie Ahern, two former Irish prime ministers, appeared before a committee in Britain’s House of Lords to discuss the impact of Britain’s decision to leave the European Union on its western neighbour. Both men were sombre. Brexit, said Mr Bruton, might deal Ireland’s economy an even heavier blow than Britain’s—even though, as he added wryly, “we had no say in that decision.” Since 1973, when both countries joined the EU’s precursor, the European Economic Community, Irish businesses have become intertwined with British ones, said Mr Ahern. Unpicking those ties would be “devastating”.

The first blow has already fallen, says Fergal O’Brien of IBEC, a business lobby group. As sterling has weakened, exports to Britain have become less competitive, and imports from Britain cheaper. Britain takes two-fifths of Irish-owned firms’ exports, and a similar share of all agricultural exports. Beef and dairy farmers are struggling, and several of Ireland’s mushroom farms, which export four-fifths of their produce to Britain, have already closed. The pain will worsen as sterling’s fall and Brexit-induced business uncertainty hit demand in Britain, says Mr O’Brien. “When your partner shoots itself in the foot, you’re bound to suffer too.”

Once Britain actually leaves the EU, Irish firms will face further difficulties. Those thinking of exporting generally start with Britain, points out Alan Barrett of the Economic and Social Research Institute, a think-tank in Dublin. And many Irish workers gain experience and training across the Irish Sea. Post-Brexit, Irish firms will struggle to break out of their small domestic market and will recruit from a shallower talent pool. Distribution and supply chains criss-cross both islands. If customs checks and tariffs were reintroduced, those links would have to be broken. Trade would fall further as rules on everything from food labelling to environmental standards diverged.

Ireland’s government is particularly worried about the border between Northern Ireland, part of the United Kingdom, and the southern Republic. For decades Northern Ireland suffered civil conflict between Republicans, who fought for a united Ireland, and Unionists committed to remaining in the United Kingdom. The Good Friday peace agreement of 1998 committed the British and Irish governments, and Northern Ireland’s devolved administration, to removing controls on the north-south border.

This has facilitated business, political and cultural links—as has the “common travel area”—a long-standing agreement that citizens of both islands can move freely between them. Brexit could “wake a lot of sleeping dogs”, says Noel Whelan, a political analyst in Dublin. Unless Britain stays in the EU’s single market and accepts free movement of people—which seems unlikely—the north’s stability is at risk.

One mooted solution is to impose customs and immigration controls not between the two countries but between the two islands. British officials would set up in the Republic’s ports and airports; Northern Irish residents would show passports to travel to the rest of the United Kingdom. That might be less unpalatable than reinforcing the north-south border. But that border will soon divide the EU from Britain, points out Dara Murphy, Ireland’s minister for European affairs, and the EU will have to agree to any deal the British and Irish governments might make. Ireland’s main concern, he says, is to ensure that both Britain and the rest of Europe understand the risks Brexit poses to peace and prosperity in both parts of Ireland.

The Irish government is seeking to salvage what it can. IDA Ireland, the national investment agency, is redoubling its efforts to sell Ireland’s well-educated workforce and low corporation tax to foreign investors. Financial services offer the most promise, says Feargal O’Rourke of PwC’s Dublin office. Irish consultants are touting the notion that banks based in London could keep the “passport” that entitles them to do business across the EU by moving a chunk of their activities to Ireland, which would be less disruptive than full-blown relocation. Some talk of Ireland gaining as many as 20,000 jobs from this.

Given the many ways in which Brexit will damage Ireland, these jobs would be merely a consolation prize. But there is no room for bitterness. The less Brexit harms Britain, the better for Ireland, points out Johnny Fallon, a political commentator—and that means Ireland must try to persuade the rest of Europe to grant Britain generous exit terms. “Some in Europe would be very happy to see post-Brexit Britain collapse,” he says. “Not Ireland. We’re very eager to see Britain hold up.”