Justice Secretary Kenny MacAskill said Abdel Baset al-Megrahi's condition had deteriorated from prostate cancer. Al-Megrahi had only served some eight years of a life sentence, but MacAskill said he was bound by Scottish values to release him.
"Our belief dictates that justice be served but mercy be shown," MacAskill said, ruling that al-Megrahi "be released on compassionate grounds and be allowed to return to Libya to die."
"Some hurts can never heal, some scars can never fade," MacAskill said. "Those who have been bereaved cannot be expected to forget, let alone forgive ... However, Mr. al-Megrahi now faces a sentence imposed by a higher power."
Al-Megrahi, 57, was convicted in 2001 of taking part in the bombing of Pan Am Flight 103 on Dec. 21, 1988. He was sentenced to life in prison.
The airliner — which was carrying mostly American passengers to New York — blew up as it flew over Scotland. All 259 people aboard and 11 on the ground died when the aircraft crashed into the town of Lockerbie.
The former Libyan intelligence officer was sentenced to serve a minimum of 27 years in a Scottish prison for Britain's deadliest terrorist attack. But a 2007 review of his case found grounds for an appeal of his conviction, and many in Britain believe he is innocent.
The White House said Thursday it "deeply regrets" the decision to free al-Megrahi.
"As we have expressed repeatedly to officials of the government of the United Kingdom and to Scottish authorities, we continue to believe that Megrahi should serve out his sentence in Scotland," the White House said in a statement. "On this day, we extend our deepest sympathies to the families who live every day with the loss of their loved ones."
Earlier, U.S. Secretary of State Hillary Clinton phoned MacAskill urging him not to release al-Megrahi, and seven U.S. senators wrote a letter with a similar message.
MacAskill said he stood by al-Megrahi's conviction and the sentence for "the worst terrorist atrocity ever committed on U.K. soil."
He said he ruled out sending the bomber back to Libya under a prisoner-transfer agreement, saying the U.S. victims had been given assurances that al-Megrahi would serve out his sentence in Scotland.
But he said that as a prisoner given less than three months to live by doctors, al-Megrahi was eligible for compassionate release.
"I am conscious that there are deeply held feelings and many will disagree whatever my decision," he said. "However, a decision has to be made."
The families of some American victims were quick to express their outrage.
"I don't understand how the Scots can show compassion. It's an utter insult and utterly disgusting," said Kara Wepz, of Mt. Laurel, New Jersey, whose 20-year-old brother Richard Monetti was on board Pan Am Flight 103. "It's horrible. I don't show compassion for someone who showed no remorse."
The Times of London reported Thursday that the private jet of Libya's leader, Moammar Gadhafi, was to collect al-Megrahi at Glasgow Airport after he was released.
Al-Megrahi's trial and conviction led to a major shift in Libya's relationship with the West.
Gadhafi engineered a rapprochement with his former critics following the Sept. 11, 2001, terrorist attacks. He renounced terrorism, dismantled Libya's secret nuclear program, accepted his government's responsibility for the Lockerbie bombing and paid compensation to the victims' families.
Western energy companies — including Britain's BP PLC — have moved into Libya in an effort to tap the country's vast oil and gas wealth.
Gadhafi has lobbied for the return of al-Megrahi, an issue which took on an added sense of urgency when he was diagnosed with cancer last year. His lawyers say his condition is deteriorating and doctors have given him less than three months to live.
The question of freeing al-Megrahi has divided Lockerbie families, with many in Britain in favor of setting him free, and many in the U.S. adamantly opposed.
British Rev. John Mosey, whose daughter Helga, 19, died in the attack, said Wednesday he would be glad to see al-Megrahi return home.
"It is right he should go home to die in dignity with his family. I believe it is our Christian duty to show mercy," he said.
But American families have largely been hostile to the idea.
"I'm totally against it. He murdered 270 people," said Paul Halsch of Perinton, New York, who lost his 31-year-old wife in the attack. "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."
Peter Sullivan of Akron, Ohio, whose college roommate Mike Doyle died at Lockerbie, said he believed Britain was putting commercial interests before the interests of the victims' relatives.
"The interest of big oil should not be the basis of a miscarriage of justice to let a murderer of 270 people be released," Sullivan said.