Al-Megrahi, 56, was given a life sentence for blowing up Pan Am flight 103 from London to New York over Lockerbie, a Scottish town, on December 21, 1988.
A total of 270 people, on board the plane and on the ground, died in the attack.
The life sentence holds a minimum term of 27 years. However, al-Megrahi's lawyers are appealing against the conviction.
The case reached the appeal court in June last year and since then has become embroiled in legal arguments.
Thursday's application was for release on bail pending the appeal which is expected next year.
Scott said: "He is very ill and does not have long to live so bail is therefore sought on compassionate grounds. There is a compelling case for the release of this man on interim liberation."
However, Clancy told the court that the plea should be dismissed.
"The crime of which the appellant stands convicted is one of incomprehensible gravity," he said.
Al-Megrahi, who is held at Greenock prison in Scotland, was not in court for the hearing.
After submissions from prosecutors and defence, the three judges hearing the case retired to consider their verdict.
It is typical that a decision on such applications is made on the day. However, it was not made clear when a result could be expected.
Jim Swire, the father of one of the victims of the bombing, supported al-Megrahi's provisional release.
"The man has reportedly got months to live," Swire, who was a spokesman for Lockerbie victims families' in the years after the disaster, said.
"My personal feelings are that to force him to remain segregated from his family and his five children for the short remaining time that he may have before him would amount to exquisite torture."
Tony Kelly, al-Megrahi's lawyer, announced on October 21 that his client had "advanced" prostate cancer which has spread to other areas of his body.