The British government attempted to block a move by Taoiseach Enda Kenny to insert an Irish unity declaration into the text of an extraordinary summit of EU leaders at the end of April, during which they adopted the EU's negotiating mandate ahead of the Brexit talks.

The text spelled out that in the event of a future unity referendum in Ireland, as envisaged by the Good Friday Agreement, Northern Ireland would automatically rejoin the European Union.

However, RTÉ News understands that the British government attempted to get the declaration delayed until after the UK General Election, so as not to damage Theresa May's chances of victory.

The Irish Government had been working on a unity declaration for months and wanted to provide legal certainty that, in the event of a successful border poll, Northern Ireland would automatically rejoin the EU.

The Taoiseach referred on a number of occasions to the German precedent, whereby East Germany immediately joined the EU at the moment of German reunification.

The so-called unity clause was to be inserted into the minutes of an extraordinary summit meeting in Brussels on 29 April.

Two days beforehand Irish officials were subject to what one source described as a sustained diplomatic offensive by Britain to try to block the declaration.

At one point, officials from the British Department for Exiting the EU tried to set up a phone call between Mrs May and Mr Kenny on the issue.

However, the officials were told that the phone call would not happen, and that Mr Kenny was sticking to his guns.

RTÉ News also understands there were phone calls to Dublin from the Northern Ireland Office, and calls from Downing Street to European Council officials in Brussels to try to get the declaration delayed until an EU summit at the end of June.

Throughout, British officials made it clear that it could damage Mrs May in the middle of an election campaign.

This followed the uproar over Gibraltar, after it emerged that the Spanish government had sought a veto over the impact any EU-UK deal might have on the disputed territory.

In the event, Mr Kenny requested the clause, and it was unanimously adopted by the other 26 member states.

A senior EU source confirmed that Downing Street had attempted to derail the Irish unity clause.

The source said that Downing Street was told in no uncertain terms that if Mr Kenny requested the unity clause it would be accepted.

The source said Downing Street was reminded that because of the Brexit result, Mr Kenny was still, "around the table", whereas Mrs May was not.