Former BP chief executive Lord Browne has said he never discussed the release of the Lockerbie bomber when he held talks with Libya's leader.
Lord Browne, whose 12 years in charge at BP ended in 2007, said he had met Colonel Gaddafi twice to discuss gas and oil exploration in Libya.
But he told an audience at the Edinburgh International Book Festival he had not lobbied the UK government for the release of Abdelbaset al-Megrahi in order to help BP land a deal.
Megrahi was jailed in 2001 for the 1988 bombing over the Scottish town of Lockerbie, which claimed 270 lives.
But he was released from prison almost a year ago on compassionate grounds because he had terminal prostate cancer.
Lord Browne said that the inclusion of Megrahi in a prisoner transfer agreement with Libya and a BP deal to look for oil in the North African country happened after he left the company.
But the US senate is investigating suggestions that BP put pressure on the UK and Scottish government to release the Libyan to aid oil deals.
Lord Browne said the bombing of Pan Am flight 103, which was flying from London to New York, had a special significance to him.
He said he had almost taken the flight and he lost a close business friend in the bombing.
Lord Browne told the Edinburgh audience: "I went to see Gaddafi twice to see if I could negotiate entry to Libya.
"It did not happen but I think I got quite a way forward."
When asked if the release of Megrahi was ever discussed, he said: "Certainly not."
In a wide-ranging book festival event, Lord Browne also said trust in BP had been "severely damaged" by the Gulf of Mexico oil spill.
He defended his own safety record during his time as BP boss. His tenure included the 2005 Texas City oil refinery explosion in which 15 people died.
The former BP chief said that the company had quickly admitted responsibility for that accident and put safety measures in place.
He told the audience there was no evidence that cost-cutting measures at the company led to the Texas City explosion and he rejected suggestions that measures he presided over could have led to the Gulf of Mexico disaster.
Lord Browne said it was too early to speculate on the cause of the Gulf of Mexico incident.
Discussing his book "Beyond Business", Lord Browne also told the Edinburgh audience how he resigned from BP three years ago after newspaper stories about his private life.
He said his attempt to cover up his homosexuality had been a "wrong move" but his resignation had been a "mixed blessing".
Lord Browne, who was dubbed the Sun King for his enormous success at BP, is now running a company which finances renewable projects.
"Beyond Petroleum", his attempt to move BP into renewable energy, had been more than just "greenwash", he insisted.
He said he had wanted BP to make the journey to more sustainable energy sources.
It is a journey which seems to have "stalled" at BP since his departure, he said.