THEY met in huge Bedouin tents in the deserts of Libya and in the rather more formal settings of Genevan hotel lobbies. The main topic on the table was how to exchange five Bulgarian nurses and a Palestinian doctor for the Lockerbie bomber.

Downing Street and the Foreign Office have denied that plans to transfer Abdelbaset Ali Mohmed al Megrahi were discussed but according to the Libyan side, that was the main reason for the talks in the first place.

Megrahi, who is serving a 27-year sentence in Greenock Prison after being convicted of the 1988 atrocity in which 270 people were killed, has said he wants to stay until he can prove his innocence. But it would undoubtedly suit certain high-level officials if the whole thing was swept under a large Bedouin carpet.

The discussions between Abdulati Ibrahim al Obidi, the Libyan Deputy Foreign Minister, Musa Kusa, Libya's foreign intelligence chief, and senior British officials have taken place in secret over the past few months.

Earlier this year they met in Geneva and set out the draft memorandum of understanding between the two countries, paving the way for suspected Libyan terrorists held in Britain to be returned to their home country.

The same two Libyan officials were involved in a similar memorandum in 2005. The Herald revealed exclusively then that one of the core reasons for the agreement was to facilitate moves to transfer Megrahi to Libya or a neighbouring Muslim state.

Again, the Foreign Office denied that Megrahi's situation was under discussion and said he would serve his entire sentence in Scotland.

Yesterday, however, Jack McConnell, former first minister, indicated that he had been privy to talks about such a transfer and had indeed helped to prevent such a move. Such disparities must make the official spokespeople very uncomfortable indeed.

Last night, sources close to the discussions confirmed that Tripoli's main motivation for the talks was to agree an exchange of specific prisoners. They would free the five Bulgarian nurses and Palestinian doctor serving life, if Megrahi was allowed to serve the remainder of his life sentence in Libya.

Libya has come under increasing pressure from the EU to release the aid workers accused of deliberately infecting children with HIV at Benghazi Hospital. The international community and medical authorities widely agree the Benghazi infections were caused by poor hygiene and that the doctor and nurses are scapegoats.

Sources explained that Tripoli wants an immediate end to the problem and from a public relations point of view, swapping Megrahi for the nurses would help the Libyans to "save face".

From that perspective, Libya seems to get far more from the deal than the UK. But understanding the machinations of such backroom discussions requires a look at the bigger picture.

Britain cut official diplomatic links with Gaddafi's regime after the murder of WPC Yvonne Fletcher in 1984. They were not restored until 2001. Since then relations have become as warm as the sunshine in Tripoli.

Prior to the September 11 attacks, Musa Kusa, one of the key deal-brokers of last week's memorandum, was not even allowed to set foot in the UK.

Kusa is thought to be behind the killing of Libyan dissidents in Britain and was expelled from London in 1980 for orchestrating the murder of a BBC World Service journalist, Mohamed Mustafa Ramadan, outside Regent's Park mosque.

He was also wanted in France in connection with the downing of a French DC-10 of the UTA airline in 1989 with 170 passengers aboard, an attack similar to the 1988 bombing of Flight 103.

Branded "the master of terror", he was welcomed back to London in late 2001.

The rehabilitation of Kusa and dramatic change in relations with Tripoli was seen as thanks for backing for the US coalition against terrorism.

In 2004, Tony Blair put his personal seal of approval on Libya's return to international respectability by shaking hands with Gaddafi, in a ceremonial Bedouin tent outside Tripoli.

The handshake came as Mr Blair's office announced that Royal Dutch/Shell had signed a $200m deal to drill for oil and natural gas off the Libyan coast and that BAE Systems, a major British defence contractor, was negotiating to sell civilian airliners to Tripoli.

Blair's meeting with Gaddafi, described by President Ronald Reagan as the "mad dog of the Middle East", also constituted a diplomatic reward for Libya's agreement to dismantle its weapons of mass destruction programmes and condemn terrorism.

When Megrahi and Al Amin Khalifa Fhimah, his co-accused were sent to Camp Zeist in 1999, the deal agreed stated that if convicted, their sentence should be served in Scotland.

Fhimah was acquitted after trial, but the conviction of Megrahi was seen as a huge triumph for the Scottish legal establishment and a symbol of changing international relations. However, doubts about Megrahi's guilt have grown ever since.

Even Lord Fraser of Carmyllie, the former lord advocate who issued the arrest warrant for Megrahi, has admitted he had doubts about the reliability of the main witness in the trial and has said Megrahi should be allowed to leave Scotland to serve the remainder of his sentence in Libya.

The former Conservative minister described Tony Gauci, the Maltese shopkeeper whose testimony was central in securing the conviction in 2001 as "not quite the full shilling" and "an apple short of a picnic".

Libya has since, in a very cautiously worded statement, accepted some responsibility for the Lockerbie bombing and paid millions of pounds in reparations to the families.

The Scottish Criminal Cases Review Commission is due to publish it's report on Megrahi at the end of this month.

'Confirming the friendship and strong ties between Libya and Britain'

MEMORANDUM of Understanding on the pursuit of agreements on judicial co-operation between the Great Socialist People's Libyan Arab Jamahiriya and the Government of United Kingdom of Great Britain and Northern Ireland.

Confirming the friendship and strong ties between the Great Socialist People's Libyan Arab Jamahiriya and the Government of United Kingdom of Great Britain and Northern Ireland; Noting the desire of both sides to strengthen judicial co-operation, in the context of our increasing joint efforts in the field of justice and home affairs, and specifically of our recently enhanced co-operation on counter-terrorism.

The participants have reached an understanding that they will shortly commence negotiations on the following matters:

  • Mutual assistance in the field of criminal law
  • Mutual legal assistance in the field of civil and commercial law
  • Extradition, and
  • Prisoner Transfer.

The two sides will work to conclude the negotiations and prepare these agreements in their final form; in the case of the last-mentioned agreement, working on the basis of the British model agreement on Prisoner Transfer presented recently to the Secretary for Justice during his visit to the United Kingdom of May 22-24 - to be signed within a period not exceeding 12 months from the date of signing this MOU.

The UK Government will seek to obtain the agreement of all three jurisdictions within the United Kingdom in each of those cases.

Signed at Sirte on Tuesday, May 29, 2007: the two original texts in Arabic and English have equal validity.

For Great Socialist People's Libyan Arab Jamahiriya.

For Government of United Kingdom of Great Britain and Northern Ireland.