The man convicted of the Lockerbie bombing has applied to Scottish ministers for release on compassionate grounds, a move which if granted would allow him to return to Libya without dropping his appeal.

Ministers received the application yesterday from Abdelbaset Ali Mohmed al Megrahi, who was diagnosed with terminal prostate cancer last year.

As with the case of prisoner transfer, the decision rests with Kenny MacAskill, the Justice Secretary. Unlike prisoner transfer, compassionate release does not require the prisoner to abandon any ongoing legal proceedings.

The Justice Secretary is thought to have released three terminally ill patients on compassionate grounds last year. Traditionally, only applications from those with three months to live are granted.

In May the Libyan government applied for prisoner transfer of Megrahi, the 57-year-old serving 27 years in Greenock prison for the bombing which killed 270 people in December 1988.

Mr MacAskill was given 90 days to make a decision. However, the transfer cannot go ahead while legal proceedings are live.

The transfer agreement allowing prisoners in the UK to be transferred to Libya was agreed in the Memorandum of Understanding signed by Tony Blair and Libya's Colonel Gaddafi in May 2007.

Megrahi has consistently protested his innocence and said he was desperate to clear his name, but the appeal has been blighted by delays and he is not expected to live to see its conclusion. Earlier this month it was delayed yet again as one of the five judges requires heart surgery.

Margaret Scott, Megrahi's QC, said: "There is a very real risk my client will die before this appeal is adjudicated."

She told the court that her client's health was deteriorating and he was experiencing a "relentless onset of symptoms".

Mr MacAskill is expected to make a decision on the transfer in the first week in August, but there has been some confusion about how the prisoner transfer agreement works. One legal expert said that ministers must give Megrahi a decision "in principle" before he drops proceedings, but officials say that is not the case.

It is thought that some of the US relatives of the victims of the tragedy would push for a judicial review if Mr MacAskill agrees to Megrahi's transfer back to Libya. Many of them are angry that the transfer is even being considered.

The families have taken legal advice in both London and Scotland. Judicial review could significantly delay Megrahi's return to Libya, but compassionate release is not subject to judicial review.

Professor Robert Black, one of the architects of Megrahi's trial in the Netherlands, said: "Compassionate release seems to achieve the humanitarian objective of allowing Megrahi to die in his homeland among his extended family, along with the public interest and criminal justice objectives of allowing a court to rule upon the validity of an appeal in the case of a conviction that has been increasingly called into question."