Ireland will have to make the European Union/United Kingdom divorce as smooth as possible, but it will also have to intensify its relationship with our "gallant allies in Europe".
Germany is now the dominant power in the future of the EU and Taoiseach Enda Kenny will need to develop our relationship with that country as much as possible.
That is just one of the challenges now facing Kenny and other members of the Government following the decision by British voters to exit the EU.
One immediate problem is how the relationship between the two parts of the island of Ireland will evolve in the years ahead.
Sinn Féin has been campaigning for a Border poll on the way to a united Ireland and the party will push that agenda that much harder now. If there is a referendum on Scotland to leave the UK then the future of Northern Ireland will also become a live political issue.
The Government and the Irish people face a whole variety of enormous challenges as a result of the UK vote. Calm heads will be needed all round to avoid making an undoubtedly bad situation an irretrievable disaster.
The decision to leave is the nightmare scenario feared by those in charge of Government Buildings. The big question now is how bad it is going to be for this country as well as for the UK.
Ministers are gathering in Dublin for an emergency cabinet meeting this morning to assess the potential scale of the damage and the actions this county needs to take to protect its position in the days and weeks ahead.
As well as the immediate implications arising from fluctuations in the euro/sterling exchange rate they will have to plot a longer term strategy to try and protect Irish interests in the months and years ahead.
Two key elements of the strategy are clear. Ireland must remain in the EU and close to the heart of the project. It must also do everything it can to make the British exit as smooth as possible.
Regardless of the resentment felt at the foolishness of the UK decision and the appalling political judgement that brought our nearest neighbours to this position, it is in our interests that the future relationship between the EU and Britain is as good as it is possible to be in the circumstances.
The precise nature of the change in the relationship will take at least two years to negotiate so there will be time to try and protect Irish interests.
The problem is that the decision itself will lead to such immediate turbulence in the financial markets that the knock on effects could manifest themselves with sudden intensity.
Dublin MEP Brian Hayes was right to describe the result as "a massive political earthquake" and pointed to the euro/sterling exchange rate as an immediate danger to Ireland.
“Ireland is right to be worried and apprehensive. As our single most important trading partner, Britain’s decision leaves us vulnerable to negative currency fluctuations,” he said in the early hours.
The danger from a big change in the exchange rate is that a steep fall in the value of sterling will have extremely negative consequences for Irish exports to Britain.
The even bigger issue is the threat to Ireland if the future of the EU itself is now thrown into doubt and that goes far deeper than trade.
Fianna Fáil leader Micheal Martin has called on the Government to be absolutely clear about the Irish position that we will not be following Britain out of the EU but there is no question of that.
The political, economic and social case for remaining is overwhelming but the challenge facing the Government is what it can do to minimise the impact of the momentous decision.
The fact that the decision will have more impact on Ireland than any other EU country is well understood in Brussels but it will need to be emphasised at a summit of EU leaders which will take place next Tuesday and Wednesday.
The Irish Government will have to be deeply involved in the long and complex process of establishing a new political and economic relationship between the EU and the UK.
One of the issues to be considered is that acting as a positive mediator in future British/EU negotiations is very much in Irish interests whatever the immediate fall out for British politics and the Cameron government.