Mr Mueller has long been involved with the Lockerbie case himself
The head of the US Federal Bureau of Investigation has launched a scathing attack on Scottish government over the release of the Lockerbie bomber.
In a letter dated 21 August, Robert Mueller said the decision had made "a mockery of justice" and given "comfort to terrorists around the world".
Abdelbaset Ali al-Megrahi has received a hero's welcome in Libya.
The Scottish government replied that it had consulted widely in the US and UK and had made the right decision.
Megrahi, the only person convicted in connection with the 1988 Lockerbie bombing, was found guilty of 270 counts of murder in 2001. He was given a life sentence.
But on Thursday the Scottish government freed the 57-year-old, who is dying from cancer, citing compassionate grounds.
In his letter to Scottish Justice Secretary Kenny MacAskill, FBI Director Robert Mueller wrote: "Your action in releasing Megrahi is as inexplicable as it is detrimental to the cause of justice. Indeed your action makes a mockery of the rule of law.
"Your action gives comfort to terrorists around the world."
Mr Mueller added that the Scottish decision made a mockery of the emotions "of all those affected by the Lockerbie tragedy".
The FBI director said he was outraged by the move, and criticised Mr MacAskill for failing to consult "partners in the investigation and prosecution of those responsible for the Lockerbie tragedy".
He wrote: "You have given those who sought to assure that the persons responsible would be held accountable the back of your hand. You have given Megrahi a 'jubilant welcome' in Tripoli, according to the reporting."
London under pressure
Mr Mueller was previously a justice department lawyer leading the investigation into the 1988 bombing.
His letter is also being sent to families of the Lockerbie victims.
Megrahi received a jubilant welcome in Tripoli on Thursday
A Scottish Government spokesman said the minister had made the right decision for the "right reasons" on the basis of due process, clear evidence, and recommendations from the parole board and prison governor.
He said: "Compassionate release is not part of the US justice system but it is part of Scotland's.
"Mr MacAskill could not have consulted more widely - he spoke with the US families, the US Attorney General, Secretary of State Clinton and many others.
Mr MacAskill said there was no reason to deny Megrahi compassion
"The US authorities indicated that although they were opposed to both prisoner transfer and compassionate release, they made it clear that they regarded compassionate release as far preferable to the transfer agreement, and Mr Mueller should be aware of that."
The spokesman said that Mr Mueller should also be aware that while many families have opposed Mr MacAskill's decision many others have supported it.
Meanwhile the British government has come under pressure over allegations that it had a role in the release.
After Megrahi's return, the Libyan leader's son Saif al-Islam Gaddafi said the decision had been linked to trade ties with the UK.
The Scottish government can take decisions independently of London on justice matters but not foreign affairs.
British Business Secretary Peter Mandelson categorically denied that a deal had been struck with Libya or that it had had any role in the move.