Alex Salmond told a committee of MPs that former Prime Minister Tony Blair’s “deal in the desert” with Libyan leader Muammar Gaddafi was a “mistake”.

Terminally ill Abdelbaset Ali Mohmed Al Megrahi eventually had a prisoner-transfer application rejected by the Scottish Government, but was released to his home country on compassionate grounds five months ago.

Mr Salmond said: “It was a mistake because it raised an expectation by the Libyan government that Mr Megrahi would be included in such a prisoner transfer.

“It was a mistake because it cut across the due process of Scots law, because one of the provisions of prisoner transfer is that legal proceedings would have to come to an end.

“It was a mistake because it was cut across what we believe to be prior agreements with the United States government and the relatives.”

Mr Salmond was appearing for the first time before the Commons Scottish Affairs committee, which is investigating communication between governments in Edinburgh and London.

Scottish ministers, including Justice Secretary Kenny MacAskill, have already complained of a lack of information coming from the UK Government.

Also giving evidence to the committee was Sir John Elvidge, the Scottish Government’s permanent secretary and most senior civil servant.

He said communication with Whitehall in the run-up to the release of Megrahi was sufficient.

“I’m in no doubt that those parts of the UK Government that needed to be aware of the timescale for the decision and the potential implication of the decision, irrespective of which way the decision went, were fully informed and fully prepared,” he said.

“We did everything we could to ensure that the UK Government had every opportunity to prepare for the moment of decision.”

Mr MacAskill turned down the prisoner-transfer application but granted Megrahi early release on health grounds.

Megrahi was serving a life sentence after being convicted of murdering 270 people when a US passenger plane was blown up over Lockerbie in 1988.

He was diagnosed with prostate cancer in September 2008 and medical evidence last summer suggested he had about three months to live.

Megrahi, the only man to be convicted for the bombing, was controversially received by crowds waving Scottish flags on his return to Tripoli.

Mr MacAskill also insisted the decision to release the bomber on compassionate grounds was "the right decision for the right reasons". Shadow Scottish Secretary David Mundell had said: "I'm not challenging the decision. You've said repeatedly it was for you and you alone, although I don't agree with it I do respect that. However, setting that aside, do you have any regrets at all about the way in which this whole matter was handled?"

Mr MacAskill replied: "No. I think I was well served by the staff who worked with me and supported me. We followed the rules and guidance. We believe we came to the right decision for the right reasons."

Mr Mundell then asked the Scottish Justice Secretary if he regretted the reception Megrahi received in Libya, the criticism Scotland received from the United States for the decision to release him, or that it was "leaked" to the press before the bomber was freed.

Mr MacAskill said: "Clearly in terms of the scenes of welcome to Mr Al Megrahi that is a matter that we publicly stated was a matter of regret. We had been given assurances by the government of Libya that there would be no joyous celebration and clearly that was not adhered to."

He said there had been "an awful lot of press speculation" about Megrahi, adding that since the bomber had been released he had twice heard reports of his death.

Mr MacAskill added: "I wouldn't believe everything you read in the papers about Mr Al Megrahi."

The minister also defended his decision to visit Megrahi in Greenock prison.

He said he had done so because the application for prisoner transfer had been made by the Libyan government, not Megrahi himself, and he wanted to find out Megrahi's view on this.

"This was the first prisoner-transfer agreement that was entered into whereby an application could be made by the national government not the individual," he said.

"And the application that came before me for prisoner transfer, not for compassionate release, came not in the name of Mr Al Megrahi but came in the name of the Libyan government."

He said UK Justice Secretary Jack Straw had made clear in such cases it was "appropriate" to find out the individual's view. "There could be an instance - it wasn't in this situation - but there could be an instance where an individual did not wish to be transferred back.

"Accordingly it is self-evident that if a government makes an application you should at least ask the person who is to be subject to transfer whether that is what they wish."

He recalled that when Megrahi was freed from prison he wore a bulletproof vest and travelled to Glasgow Airport in a bomb-proof vehicle.

Given that, Mr MacAskill said: "It appeared perfectly appropriate that it would be better for me to go to the security of Greenock prison where he was detained."