Former taoiseach Charles Haughey did not want the bodies of three IRA members shot dead by the SAS in Gibraltar to be taken home through Dublin, according to newly-released archived British papers.

An undercover British military unit opened fire in March 1988 because they believed the republicans were about to detonate a remote-controlled bomb in the tiny British territory in the Mediterranean.

The late Mr Haughey urged that the RAF fly their remains straight to Belfast rather than allowing their families to bring them through Dublin, which could have been seen as a propaganda coup for Sinn Féin.

His secret intervention was disclosed in Northern Ireland Office (NIO) documents newly-released by the Public Record Office of Northern Ireland (PRONI).

Sean Savage, 24, Mairead Farrell, 31, and Daniel McCann, 30, were shot dead as they walked towards the Spanish border.

Critics of former British prime minister Margaret Thatcher's government claimed it was part of unofficial shoot-to-kill policy pursued against the IRA by crack troops.

An inquest found the British commandos acted within the law when they shot dead the unarmed republicans, who were hailed as martyrs by IRA supporters.

However, in 1995, the European Court of Human rights ruled that the killings had violated Article 2 of the Convention on Human Rights, which protects the right to life.

In the documents released today, an official wrote: "Haughey this afternoon implored us personally through the ambassador in Dublin to ensure that the bodies of the three IRA terrorists shot in Gibraltar were kept out of the Republic at all costs.

"He made clear that he would not admit to this request in public."

The NIO file was released as part of the disclosure of 1991 papers.

It said Mr Haughey's idea following the Gibraltar killings was that the RAF would fly the bodies direct to Belfast, rather than via a charter flight to Dublin organised by the families of the dead.

A civil servant claimed: "This proposal is clearly designed to solve a problem confronting Mr Haughey.

"It has however the attraction for us that it could short-circuit the current plans of the terrorists' relatives, to whom the bodies have been released today."

It said the families wished to take the remains to Dublin to secure maximum political advantage for Sinn Féin.

"There is also no guarantee that the families can be squared in the way Mr Haughey apparently envisages, in which case we would be left in the most invidious position of appearing to countenance a dubious bargain with Sinn Féin."

The official said one of the sticking points with the families was the use of Aldergrove airport in Co Antrim, which was regarded as unionist territory.

Another civil servant said it was "inconceivable" to use the RAF to fly the bodies home.

"The problem of how to manage any problems in the Republic must be for Mr Haughey himself, after all he has done a good deal to create them."

At the trio's funerals in Belfast's Milltown cemetery, loyalist gunman Michael Stone opened fire and threw grenades at mourners, killing three and wounding 50.

Three days later, two British soldiers were seized by a mob while driving through republican west Belfast during the funerals of those killed at Milltown.

They were dragged from their car and murdered - the scenes recorded on television.