LAST week Nicola Sturgeon announced that a “Scottish Hub” was being set up at the British Embassy in Dublin. The diplomatic initiative – which will focus in particular on trade and investment – is the latest example of the growing relationship between Scotland and its nearest sovereign neighbour.

After centuries locked in very different trajectories, Scotland and Ireland have grown much closer in recent years.

In February, Irish foreign minister Charlie Flanagan, on an official visit in Edinburgh, talked of “a new chapter” opening up in Scottish-Irish relations – and with good reason.

Ireland is Scotland’s eighth largest export market, with £920 million exported to its shores in 2013 (up 12 per cent from 2012). Some 6000 Scottish jobs are directly dependent on Irish companies. Perth-based SSE owns Airtricity, one of the major players in the Irish energy market.

But the Celtic rapprochement goes beyond the balance sheet.

Governments at Holyrood and Leinster House, in Dublin, have traded policy lessons on everything from smoking bans and plastic bag charges to minimum pricing on alcohol. There was significant Scottish interest in last month’s marriage equality referendum in Ireland, too.

“Over the past 20 years [Scotland and Ireland] have become much closer,” says Pat Bourne, Ireland’s consul general to Scotland, based in Edinburgh. “It’s the Good Friday Agreement, the cross-island institutions, devolution.”

The Consulate General of Ireland in Scotland was set up in 1999, in the wake of devolution. The British-Irish Council, established under the Good Friday Agreement, has a permanent secretariat in Edinburgh.

After a lull during the recession, diplomatic relations between Dublin and Edinburgh are on the up. Another Irish diplomat is to be assigned to the council later this summer. In 2012 no Scottish government ministers visited Ireland, and just one went the other way.

This year there have already been eight ministerial visits between Ireland and Scotland.

The Irish government conspicuously avoided any active involvement in last year’s independence referendum, but has expressed a desire to work more closely with Holyrood, especially on trade and tourism.

As well as political developments – the creation of the Scottish parliament, the end of the Troubles in Northern Ireland – there are more prosaic reasons for the growing links between Edinburgh and Dublin.

“Probably Michael O’Leary and Ryanair should take some of the credit,” says Bourne. “Thirty years ago people in Ireland knew Edinburgh existed but few would have been here. Now they come for the festival, Murrayfield, stag nights.”

Of course, Scotland and Ireland have plenty in common: two countries of roughly similar size on the edge of Western Europe, with just 12 miles separating Kintyre from Northern Ireland, with a shared history of migration stretching all the way from the ancient kingdom of Dalriada to the stream of young Irish graduates who came to Scotland in the wake of the recession.

But what bound Scotland and Ireland has often divided as well. From 1700, often-antagonistic cultural and political identities emerged on both sides of the

Sea of Moyle between Protestant industrial Scotland and Catholic agrarian Ireland. Sectarian friction was common. Breaking down these old barriers has taken time.

“The last 20 years has just been about getting past the historical baggage,” says Pat Bourne. “When you consider how close Ireland and Scotland are physically we shouldn’t even be having this conversation.”

Unsurprisingly, interest in Irish history has risen in Scotland. Alex Salmond, quoting Irish poet WB Yeats, talked of Britain “changed utterly” after the referendum. Much – probably too much – has been made of the echoes between the Irish home rule crises, the sweeping Sinn Fein General Election victory in 1918 and the contemporary rise of the SNP.

History has been pivotal in bringing Ireland and Scotland closer together, says professor Sir Tom Devine, who traces the detente between the two nations to a series of academic history conferences held in Dublin and Edinburgh in the late 1970s and early 80s. At the time political relations between Scotland and Ireland were practically non-existent.

“It was an extraordinary development of the umbilical cord of the mind,” says Devine. Out of these tentative intellectual exchanges emerged the Irish-Scottish

Academic Initiative. In 1999 then Irish president Mary McAleese opened the Institute for Scottish and Irish studies in Aberdeen. There are similar centres in Dublin, Glasgow and even Dunedin.

Edinburgh University is now the leading centre for Irish history outside of Ireland.

The political connection between Scotland and Ireland developed out of this “academic spine” says Devine.

During the 2000s, Ireland was often held up as an exemplar by the SNP, with Salmond appealing to Scots to join the so-called “arc of prosperity”. The death of Ireland’s Celtic Tiger did little damage to Scottish nationalism but provided an all-too-graphic illustration of the need for an independent Scotland to chart a path away from regulation-light financial capitalism.

“I think Ireland has done Scotland a great favour by collapsing, “ says leading Irish writer and journalist Fintan O’Toole, who was at Edinburgh University earlier this month to deliver a lecture titled After Independence. “It burst that bubble. All that rhetoric around the Celtic Tiger is usefully gone. It is really important that you know in advance that that was all rubbish.”

A regular visitor during the referendum, O’Toole says Scotland is well-placed to avoid some of the mistakes made by

Ireland after the formation of the Free State in 1922. But, he says, nationalists and unionists need to recognise how much would stay the same if Scotland were to leave the UK.

“A lot of things stay the same, a lot of the institutions stay the same,” says O’Toole. “Ireland in very fundamental ways has remained British in its skeletal structures.” The question for Scottish nationalists, based on Ireland’s experience, is whether independence would produce a better society.

“We have to think of independence as one moment in a process rather than as a transformative moment,” he says. “You need to know what you want to be independent for.”

The independence referendum sparked “a lot of interest and a lot more awareness” in Ireland, says Paul Gillespie, former foreign editor at the Irish Times. “It is a working out of Scottish self awareness that catches the imagination of a certain kind of Irish nationalism.”

Nicola Sturgeon’s recent performances won plaudits in Ireland, too.

There is, however, one iceberg on the horizon that could pierce the hull built between Dublin and Edinburgh: the European Union referendum.

A UK exit would have serious ramifications for Ireland, particularly Northern Ireland. “Europe provided the framework within which Britain and Ireland could end the diplomatic stand-off,” says Duncan Morrow, professor of politics at the University of Ulster. “An EU exit would produce a land border, it would strand Catholics in a state that is antagonistic.”

As a measure of Dublin’s concern over “Brexit”, a special unit in the Taoiseach’s office and a Dail committee has been established to monitor the situation.

In the meantime, the bloom in relations between Ireland and Scotland shows no signs of wilting. In March, Edinburgh Castle was bathed in green light for St Patrick’s Day.

The rapprochement is about much more than a shared animus in perfidious Albion, says Irish consul Pat Bourne.

“There is sometimes an analysis that there is something strategic, even sinister in the closeness between the Ireland and Scotland in recent years, that it is part of a cunning SNP plot or likewise Ireland Inc is cunningly praying for Scottish independence,” he says. “I would reject that. What we are seeing is a catching up to a quality and a quantity of a relationship that should have existed long ago.”