BBC Scotland political correspondent Glenn Campbell answers key questions surrounding the decision to release the Lockerbie bomber from jail.
Why has Megrahi been released?
He is terminally ill with prostate cancer. Doctors have advised the Scottish Government he may have less than three months to live, which normally qualifies a prisoner for release on compassionate grounds.
What determines compassionate grounds and does it work differently in Scotland, compared to the rest of the UK?
Compassionate release is not unique to the Scottish justice system. The UK Government's justice secretary, Jack Straw, recently freed the great train robber Ronnie Biggs from jail on that basis.
Who made the decision?
Megrahi's fate was decided by the Scottish justice secretary, Kenny MacAskill. He has a legal background and serves in the Scottish National Party's devolved government, which sits at Holyrood in Edinburgh.
Does Westminster have a say?
No. International relations for the whole UK are dealt with by Westminster, but Scottish justice falls under Holyrood control. The Foreign Office may well have an interest in the outcome, but has repeatedly made clear the decision is entirely for Scottish ministers.
Why is there so much anger in the US?
Many US relatives of those who died are convinced of Megrahi's guilt. They believe he showed no mercy to the loved ones they have lost and do not believe he deserves any compassion.
Megrahi has always protested his innocence, and convinced some British relatives he is the victim of a miscarriage of justice.
How has the Scottish Government handled the decision?
This is a no-win decision for the Scottish Government. Any one of the options open to it would have drawn fierce criticism.
If there had been a last-minute change of heart, the devolved administration would have been ridiculed for crumbling under pressure from the United States.
Is the strength of evidence against him a factor in his release?
No. The evidence would have been tested in court again, had Megrahi not dropped his second appeal against conviction and sentence.
What political ramifications could the decision have?
This is arguably the single most important decision the Scottish Government has ever taken. If Megrahi is welcomed home to Libya as a national hero, the celebrations could rebound badly on the devolved administration.
Internationally, the decision will do no harm to US-Libya or UK-Libya relations - and may well make it easier for British companies, like BP, to do business in Libya.
What are relations like between the UK and Libya?
Improving. Gordon Brown recently met Libyan leader Muammar Gaddafi at the G8 summit in Italy.
Former prime minister Tony Blair travelled to Libya to meet him in 2004 and 2007 and prompted the first discussion about the possibility of release when he agreed in principle to a prisoner transfer agreement between the UK and Libya.