Labour, Conservatives and Liberal Democrats all supported each other’s amendments on the affair, making defeat for the Scottish Government inevitable, but for Labour it was a pyrrhic victory as revelations about Gordon Brown’s “respect” for the decision overshadowed events at Holyrood.

All 47 SNP members backed the Justice Secretary, as did both Green MSPs and Labour rebel Malcolm Chisholm. Tory MSP Ted Brocklebank, who made a friendly intervention during Mr Chisholm’s speech, chose to record no vote. The vote on the issue therefore went 73-50 against the government with Margo MacDonald the sole formal abstention and four non votes – the presiding officer and three absentees.

No LibDems rebelled, in spite of three MSPs – John Farquhar Munro, Hugh O’Donnell and Mike Pringle – indicating in advance that they supported the general decision on Megrahi.

Scottish Labour’s leader Iain Gray used the vote to call for a parliamentary inquiry into the saga, saying: “Tonight the Scottish Parliament has made clear its opposition to both the decision to release Megrahi to Libya and the woeful handling of the decision and announcement.”

He said that there were still no answers on issues such as why Mr MacAskill chose to visit Megrahi in Greenock ­prison, why more medical information was not forthcoming, and why the Justice Secretary did not take into account the length of sentence and severity of offence.

“I believe it’s time that the Justice Committee of the Scottish Parliament examines the areas of concern that are in the parliament’s remit as a matter of urgency,” said Mr Gray.

But a spokesman for Mr MacAskill said: “Labour’s attempt to pursue partisan politics on a justice issue has left them looking ridiculous and hypocritical in light of the Prime Minister saying that he ‘respects’ the decision, and the Foreign Secretary confirming that he did not want Megrahi dying in a Scottish prison.

“In rejecting the tainted Prisoner Transfer process and granting compassionate release, Kenny MacAskill made the right decisions, above all for the right reasons.”

The government motion had simply noted that the decision to release Megrahi had been taken in line with reports and endorsed it as consistent with the principles of Scottish justice.

Labour’s amendment erased all this and criticised the mishandling of the decision, said it was wrong to meet Megrahi, criticised supposed leaks of the announcement, claimed insufficient medical evidence had been found, spoke of damage to Scotland’s reputation, and concluded that because of these factors the parliament “does not agree with his decision to return Megrahi to Libya on compassionate release.”

The Tory amendment further criticised the decision not to release Megrahi to die at “an appropriate location” in Scotland, while the LibDems added that the decision did not serve the relatives of the Lockerbie victims and should have been made first to Parliament.

First Minister Alex Salmond told parliament “Opinion is divided – but I am proud and happy to have the support within Scotland of the Church of Scotland and Archbishop Mario Conti of the Catholic Church and I am even prouder to have the support of Nelson Mandela, which indicates the respect for a Scottish judicial decision across this planet.”

It fell to him to break the news about Gordon Brown’s “respect” for the decision – a note was passed to him as the debate over-ran its time.

Mr MacAskill told MSPs that at every step he had followed procedure and the documents released on Tuesday had substantiated that, but Mr Gray insisted: “I said compassion had to be balanced against the enormity of the crime and the guidance says I was right.”

Tory leader Annabel Goldie said evidence that Gordon Brown was telling the Libyans that he did not want Mr Megrahi to die in jail was damaging for the Prime Minister, and she accused Mr Brown and Mr Salmond of “nudge-and-wink diplomacy” on the case.

Tavish Scott, the Scottish LibDem leader, said: “On the handling, and the spin, and the manipulation, this government put publicity before responsibility.”

Labour backbencher Elaine Murray, MSP for Dumfries, said: “Even today, the town struggles under the yoke of being solely associated with the bombing.”

Her voice shaking with emotion, she contrasted two religious festivals – Megrahi’s wish to return to Libya to observe Ramadan with the atrocity that visited Lockerbie on the eve of Christmas.

Former Labour First Minister Jack McConnell said assurances had been made that Megrahi would serve his sentence in Scotland.

“We Scots have been trusted the world over, our justice system has been admired for centuries, but in one announcement this reputation has been damaged, tarnished for years to come.”

He said Mr MacAskill should not have met Megrahi, a “Libyan secret service agent trained to manipulate and mislead”.

The main voice of dissent across party lines came from Malcolm Chisholm, MSP for Edinburgh North and Leith, who said he would vote with the government.

Opinion is far more evenly divided on this issue than some people think.

“Equally, it is more divided internationally and even more divided among the victims’ families.”

He accepted an intervention from Mid-Scotland and Fife Tory MSP Ted Brocklebank, who backed his stance, saying it was better a guilty man go home to die than an innocent man languish in prison.