COLONEL Muammar al-Gaddafi's motive for giving a hero's welcome to freed Lockerbie bomber Abdelbaset Ali Mohmed al-Megrahi is revealed today in secret US diplomatic cables obtained by WikiLeaks and seen by The Scotsman.
The cables reveal that the regime's handling of the homecoming was heavily influenced by Col Gaddafi's simmering resentment towards the West over the case of six Bulgarian nurses freed from a Libyan jail in 2007.
The nurses had been jailed for life for allegedly infecting 400 Libyan children with the HIV virus. European Union diplomats negotiated their release - but then reneged on a deal that the nurses should serve the rest of their sentences in jail in Bulgaria.
Col Gaddafi's lingering anger at this diplomatic "insult" is revealed in a cable, written by a diplomat, describing a meeting in Tripoli between the colonel and US senator John McCain, shortly before Megrahi's release. The Libyan leader refused to give any guarantees about the tenor of Megrahi's homecoming, the cable reports, despite Mr McCain's warning that a hero's welcome could severely damage Libya's new friendship with the United States.
Col Gaddafi cited the celebrations that met the nurses in Bulgaria after their release.
"Calling them murderers, (Gaddafi] remarked in a tone of disbelief that they were welcomed home by the Bulgarian president himself," the cable reads. Col Gaddafi told Mr McCain the Libyan people would decide how to welcome home the Lockerbie bomber.
The cases of Megrahi and the Bulgarian nurses had long been linked in Col Gaddafi's mind.
Wikileaks: The Megrahi cables
• Revealed: Inside story of Megrahi's return home
• John McCain: Senator issued warning over celebrations
• Moussa Koussa: Foreign minister held in esteem by US diplomats
• Tortured into confessing, later released
While the nurses were still in jail, he repeatedly tried to barter a prisoner swap with the West - exchanging the nurses for the Lockerbie bomber.
These approaches were always rebuffed by the West, to Col Gaddafi's frustration.
Megrahi, the only person convicted of the Lockerbie bombing in which 270 people were killed, was freed from Greenock jail on 20 August, 2009, after being granted compassionate release due to advanced prostate cancer.
The decision by the SNP government to free Britain's biggest mass murderer met an angry response from the US government and most of the relatives of the Lockerbie dead.
Jubilant scenes on Megrahi's arrival at Tripoli airport - when Libyans waved saltires in celebration - were beamed around the world to universal condemnation.
Despite the Scottish Government's declared belief at the time that Megrahi had less than three months to live, he is still alive - staying in a high-class Tripoli suburb - 34 months later.
Gordon Brown, prime minister at the time, had written to Col Gaddafi before Megrahi's release, urging Libya to "act with sensitivity".
Read the cables online
• Megrahi returns to Libya accompanied by Saif al-Islam
• CODEL McCain raises Megrahi with Libyan leader
• Libyan officials "disappointed" with Megrahi reception, working behind scenes to prevent September 1 repeat
• Conflicting messages on pending release of Abdel Bassett Al-Megrahi
• Qadhafi personally welcomes Lockerbie bomber
• Demarche delivered: Encouraging a measured response to Megrahi's releaseUS president Barack Obama had also called the Libyans, to urge them to dispense with any celebrations.
But in the event, hundreds of people gathered in Tripoli to welcome Megrahi home.
Festive songs blared from a PA system and hundreds danced and cheered, wearing T-shirts bearing the face of the bomber.
The White House described the scenes that greeted Megrahi as "outrageous and disgusting".
The then foreign secretary David Miliband said: "The sight of a mass murderer getting a hero's welcome in Tripoli is deeply disturbing, especially for the 270 families and also for anyone who has got an ounce of humanity in them."
First Minister Alex Salmond also claimed the reception for Megrahi was "not appropriate" while justice secretary Kenny MacAskill condemned the scenes in Tripoli and later told MSPs he had received assurances from the Libyans that the return would be low key. Mr MacAskill, on whose decision the release ultimately rested, described the scenes as "a matter of great regret" and accused both the Libyan authorities and Megrahi of being "insensitive" and showing "no compassion".
The Scotsman and its sister paper Scotland on Sunday have had access to secret US diplomatic cables under an agreement struck with WikiLeaks, the international whistleblowing organisation headed by Julian Assange.
More: the Iraq cables
• Wikileaks: US anger at Gordon Brown's Iraq withdrawal
• Wikileaks: Gordon Brown 'wanted to undo Tony Blair's Iraq mistake'
• Basra: timeline of UK military involvement in Iraq
• Leader: Historical insight
The US government has criticised The Scotsman for its tie-up with WikiLeaks, saying: "Any unauthorised disclosure of classified material is regrettable as it has the potential to harm individuals as well as efforts to advance foreign policy goals."
But the cables provide valuable new insights into one of the most iconic moments in recent Scottish history. They reveal:
• The United States tried to add conditions to the Scottish terms of Megrahi's release, demanding he be imprisoned for the rest of his life in Libya following his compassionate release.
• Megrahi's homecoming and how to handle it became a tussle within the Libyan regime, between reformers who favoured friendlier ties with the West and hardliners who saw such moves as a weakening of Libya's strongman status.
• Western diplomats who urged a low-key return for Megrahi believed they had an ally in Moussa Koussa, the Libyan foreign minister who subsequently defected to the West shortly after Nato sided by the rebels in the Libyan uprising this spring.
• The triumphant return of Megrahi to Libya was in fact a much lower-key welcome than some hardliners planned, with a crowd of many thousands scaled down to a few hundred at the last minute.
A spokesman for the US Consulate in Edinburgh said last night: "The Department of State does not comment on classified documents which may have been leaked.With regard to the diplomatic community's practice of cable writing, these cables are often preliminary and incomplete expressions of foreign policy and should not be seen as having standing on their own, or as representing US policy.
"Any unauthorised disclosure of classified material is regrettable as it has the potential to harm individuals as well as efforts to advance foreign policy goals shared by nations around the world.
"The US government is committed to ensuring our private communications are secure, and steps have been taken to enhance the security of our systems to prevent the illegal leaking of information. The expectation of privacy among those with whom we engage is a responsibility that we take very seriously."