Updated

The British government feared a furious Libyan reaction if the convicted Lockerbie bomber wasn't set free and expressed relief when they learned that he would be released on compassionate grounds, leaked U.S. diplomatic cables show.

A cache of cables from the U.S. Embassy in Tripoli describes the run-up to the decision to free Abdel Baset Ali al-Megrahi, a former Libyan agent whose freedom on Aug. 20, 2009, sparked jubilation in Libya but roiled relations between London and Washington.

Critics of the decision on both sides of the Atlantic have alleged that British officials were motivated by commercial interests -- including those of energy company BP PLC -- when they moved to free al-Megrahi, the only man convicted in the 1988 attack on Pan Am Flight 103.

While officials here have always stressed that the 58-year-old al-Megrahi was released because he suffers from terminal prostate cancer, the cables show the Brits were keenly aware that they faced a hugely damaging backlash if they didn't do as the Libyans wanted.

The U.K. was caught "between a rock and a hard place," an Oct. 24, 2008 U.S. cable warned. "The Libyans have told HMG (Her Majesty's Government) flat out that there will be 'enormous repercussions' for the UK-Libya bilateral relationship if (al-)Megrahi's early release is not handled properly."

Britain's ambassador to Tripoli, Vincent Fean, said a few months later that a refusal to release the convicted terrorist would have meant disaster for British interests in Libya.

"They could have cut us off at the knees, just like the Swiss," the cable quotes Fean as saying.

Fean seemed to be referring to the Swiss detention of Moammar Gadhafi's son and daughter-in-law in July 2008 for assaults on their servants in Geneva -- arrests that sparked a spectacular collapse of relations between the two countries. Tripoli suspended visas for Swiss citizens, withdrew funds from Swiss banks, stopped oil shipments, reduced flights to Switzerland, and imprisoned two Swiss businessmen in retaliation -- forcing Switzerland into an embarrassing apology.

British officials have long acknowledged that commercial interests -- as well the desire to deepen anti-terrorism cooperation -- played a role in the U.K.-Libyan prisoner transfer agreement which first raised the prospect of al-Megrahi's release.

But they have always stressed that the decision to release al-Megrahi on compassionate grounds was made independent of that deal, and that, in any case, officials in the Scottish capital of Edinburgh had the final say on whether to set him free.

Scotland has insisted that its decision was made on humanitarian grounds alone, although one cable does suggest that Libya tried to lean on the Scottish Executive to do its bidding.

Scottish First Minister Alex Salmond is quoted in the cables as telling a U.S. official that the Libyan government had offered the Scottish government "a parade of treats" in return for a deal on al-Megrahi's release -- although he was also quoted as saying the inducements were turned down.

Salmond's office on Wednesday said he had been misquoted in the cable.

"There were no 'parade of treats,"' an e-mail from Salmond's office said. "He never said that at any stage."

Al-Megrahi is still believed to be alive in Libya, even though doctors estimated he only had a few months to live when he was freed.