Mr Mandela expressed his support through a letter to the government
Nelson Mandela has backed the Scottish Government's controversial decision to free the Lockerbie bomber.
The former South African president has expressed appreciation for the decision to release Abdelbaset Ali Mohmed al-Megrahi on compassionate grounds.
US President Barack Obama is among those who have criticised the decision to free Megrahi, who is terminally ill.
But Scottish First Minister Alex Salmond said there was huge support internationally for the move.
Megrahi, who has prostate cancer, was released eight years into his 27-year sentence for the murder of 270 people in the 1988 bombing of Pan Am 103.
Hundreds of people were waiting in Libya to welcome Megrahi home as his plane landed in Tripoli, some of them waving Saltire flags.
Mr Mandela's support came in a letter to the Scottish Government from Prof Jake Gerwel, chairman of the Mandela Foundation.
"Mr Mandela sincerely appreciates the decision to release Mr al-Megrahi on compassionate grounds," it stated.
The letter went on: "Mr Mandela played a central role in facilitating the handover of Mr al-Megrahi and his fellow accused to the United Nations in order for them to stand trial under Scottish law in the Netherlands.
"His interest and involvement continued after the trial after visiting Mr al-Megrahi in prison.
"The decision to release him now, and allow him to return to Libya, is one which is therefore in line with his wishes."
Responding to the letter, Mr Salmond told the BBC News Channel: "We have seen today that Nelson Mandela has come out firmly in support, not just as the towering figure of humanitarian concern across the world in the last generation, but of course somebody who brokered the agreement that led to the Lockerbie trial in the first place.
"Many people believe that you will achieve more in this world through acts of mercy than you will through acts of retribution."
Mr Mandela visited Megrahi in Glasgow's Barlinnie Prison in 2002.