The families of American victims of the Lockerbie bombing reacted angrily to the news.
Kara Weipz, of Mt Laurel, New Jersey, who lost her 20-year-old brother Richard Monetti, said: "I don't understand how the Scots can show compassion. It is an utter insult and utterly disgusting.
"It is horrible. I don't show compassion for someone who showed no remorse."
New York state resident Paul Halsch, whose 31-year-old wife was killed, said of Mr MacAskill's decision: "I'm totally against it. He murdered 270 people.
"This might sound crude or blunt, but I want him returned from Scotland the same way my wife Lorraine was and that would be in a box."
However, British relatives' spokesman Dr Jim Swire, who lost his daughter Flora in the atrocity, said he believed Megrahi had "nothing to do with" the bombing.
"I don't believe for a moment that this man was involved in the way that he was found to have been involved," he said.
Have Your Say I am ashamed to be Scottish today. Where is the justice for the victims?
Ross MacDonald, Edinburgh
Send us your comment
"I feel despondent that the west and Scotland didn't have the guts to allow this man's second appeal to continue because I am convinced had they done so it would have overturned the verdict against him.
"It's a blow to those of us who seek the truth but it is not an ending. I think it is a splitting of the ways."
The BBC's Christian Fraser in Tripoli said that until now, Libyan officials had been careful not to comment in case they jeopardised the release, wary of last minute interventions by the US Secretary of State Hillary Clinton.
Officially there are unlikely to be any triumphant statements, but given the personal involvement of Mr Gaddafi it will no doubt be seen as further evidence of his growing stature on the international stage, our correspondent said.
It is rumoured that he has asked to see Megrahi when he returns, and the timing is perfect - in 12 days' time Libya celebrates the 40th anniversary of the revolution that brought Muammar Gaddafi to power, he added.
Our correspondent said Megrahi's release has been billed by the leader as the new dawn for Libya, and to many it will be viewed as a more palatable ending to one of the darkest chapters in the country's history.
Appeal dropped
Megrahi was convicted of murder in January 2001 at a trial held under Scottish law in the Netherlands.
A first appeal against that verdict was rejected the following year.
However, in 2007 the Scottish Criminal Cases Review Commission granted him a second appeal.
It subsequently emerged he was suffering from terminal cancer but a bid to have him granted bail was refused.
His second appeal got under way this year but shortly afterwards applications were made for both his transfer to a Libyan jail and release on compassionate grounds.
Earlier this week the High Court in Edinburgh allowed Megrahi's application to drop his second appeal.