Scotland was set up to "take the rap" for the release of the Lockerbie bomber, according to former Scottish justice secretary Kenny MacAskill.

Mr MacAskill likened the SNP government's involvement to "flotsam and jetsam, the same as the bags that fell upon the poor town of Lockerbie and the people there".

Mr MacAskill insisted the Scottish Government had not been complicit in any prisoner transfer deals for Abdelbaset al-Megrahi, the only man convicted of the atrocity, and had "no control and little influence".

The decision to return Megrahi to Libya in 2009 was taken by Mr MacAskill on compassionate grounds.

Read more: Kenny MacAskill: Scottish Government 'tried to win more powers as part of Lockerbie agreement'​

He said Scotland had not gained anything from the decision, and accused British and American politicians of hypocisy for criticising it while working to secure deals with Libyan leader Muammar Gaddafi to further commercial interests.

The former politician made the comments at the Edinburgh International Book Festival, as he discussed his book The Lockerbie Bombing: The Search For Justice.

The Herald: The wreckage of Pan Am Flight 103

He said: "We got nothing out of it (Megrahi's release). The Scottish Government and indeed Scotland got a black spot, not simply the bomb that landed and devastated the town of Lockerbie."

He went on: "There was no deal done by us but there were certainly deals done internationally.

"We had no control and little influence, we knew things were happening, but you have got to remember it suited people to be able to put the blame on somebody and say it was Scotland.

Read more: Kenny MacAskill: Tory MP threatened to 'pull edition of Herald' over Lockerbie story​

"Because Obama, Clinton and Straw, all of them came out with it and said we don't agree with it, and they had been conniving and working for it.

"We had actually delivered what they wanted which was to let Megrahi go, but what I can give you an assurance on is that we did so following the rules and regulations of Scotland."

The Herald: Democratic presidential candidate Hillary Clinton (AP)

Mr MacAskill said: "We took the rap for Lockerbie but there were huge international deals going on that were commercial and were security.

"And we were just flotsam and jetsam the same as the bags that fell upon the poor town of Lockerbie and the people there."

Controversy continues to surround who was responsible for the 1988 bombing in which 270 people died.

The Pan Am flight on its way from London to New York exploded above Lockerbie, killing everyone on board and 11 people on the ground.

The politician argues that Megrahi, who died in Libya in 2012, was "a bit player" in an act of "state-sponsored terrorism".

He said: "The major person responsible for this was Colonel Gaddafi, supported by Senussi (Libyan intelligence chief) and various others in senior positions."

Read more: Nicola Sturgeon: Only courts can decide if Lockerbie conviction is unsafe​

But while he described the Libyan's conviction as "extremely weak", he said the Scottish justice system and police had "acted honestly and with integrity".

Mr MacAskill said debate would "run and run", stating Lockerbie was "up there with the grassy knoll along with 9/11" in terms of international incidents in which conspiracy theories rage.

"I don't think we will ever get to the bottom of this. Equally, I am highly sceptical as to whether a Scottish court or a Scottish inquiry could ever get to the bottom of this," he said.