The Libyan jailed for the 1988 Lockerbie bombing was granted release on compassionate grounds in Scotland on Thursday, despite fierce US opposition to freeing him.
In a move likely to be hailed by Libya as a new sign of its return to global respectability, Abdelbaset Ali Mohmet al-Megrahi, who has terminal prostate cancer, was given his freedom by Scottish Justice Secretary Kenny MacAskill.
MacAskill said Megrahi, who medics say has less than three months to live, could return to Libya to die because Scottish law required that "justice be served but mercy be shown."
The 57-year-old "now faces justice from a higher power... he is going to die," MacAskill added.
In Tripoli, an official in the Libyan prime minister's office said, "He is free and will arrive in Libya in the next few hours." Earlier officials at a military airport near Tripoli said preparations were under way for his return.
Megrahi is the only person convicted of blowing up Pan Am flight 103 over the Scottish town of Lockerbie, killing 270 people, in Britain's worst ever terror attack. He has served just eight years of a minimum 27-year sentence.
MacAskill has been considering three options in Megrahi's case: transferring him to a Libyan jail, freeing him on compassionate grounds or keeping him in Greenock prison, near Glasgow in western Scotland.
In the run-up to the decision, Secretary of State Hillary Clinton has led strong US opposition to Megrahi's release. Seven US senators also wrote to the Scottish government demanding that Megrahi, convicted in 2001 after a trial held under Scots law at a special court in the Netherlands, serve out his sentence in Britain.
Many US relatives agree. Frank Duggan, president of the Victims of Pan Am Flight 103 group which represents US victims' families, told BBC radio Thursday, "Even if he's dying, he was supposed to spend the rest of his life in prison in Scotland and he's not, he's going back to Libya."
Following the announcement, Megrahi was expected to return to Libya quickly and could be back with his family in time for the Islamic holy month of Ramadan which starts on Friday.
The Times reported that Libyan leader Moamer Kadhafi was to send his private jet to collect Megrahi and take him home. The decision comes amid thawing relations between Libya and Britain, which were arch-enemies in the 1980s and 1990s.
Libya has the largest proven oil reserves of any country in Africa, much of it still untapped, and British firms including BP and Shell have signed major exploration deals in the country in recent years.
Saad Djebbar, a lawyer who has worked with the Libyan government on the case, told BBC radio that freeing Megrahi would be a huge boost to relations between Britain and the whole Arab world.
"Rest assured that the (Scottish) government has done the UK government a great favour," he said. "Britain and Scotland will grow in the eyes of the Arab states".
One major obstacle to Megrahi returning to Libya was removed on Tuesday when Edinburgh's High Court ruled that he could drop his appeal against conviction.