The Scottish government today released Abdel Basset Mohamed al-Megrahi , who suffers from terminal prostate cancer and was convicted for his role in the 1988 bombing of Pan Am Flight 103 , which exploded in the air over Scotland , killing all aboard and several on the ground .