The decision to release the former Libyan intelligence agent on compassionate grounds was made after his lawyers said he was dying of prostate cancer.