Jack Straw decided two years ago that it was in the UK's "overwhelming interests" not to exclude the Lockerbie bomber from a prisoner transfer agreement with Libya, it has emerged.
Mr Straw's stance was set out in letters to Kenny MacAskill, the Scottish justice secretary who recently provoked anger by releasing Megrahi on compassionate grounds.
The bomber was not released as part of the prisoner transfer agreement. But the disclosure of Mr Straw's letters, by The Sunday Times, is likely to raise questions about the Government's position on Megrahi's return to Libya earlier this month.
Ministers have rejected suggestions that the release was tied in to Britain's commercial interests but have refused to state whether they agree with Mr MacAskill's highly controversial decision.
The Sunday Times reported that Mr Straw's apparent change of stance came at a crucial time in negotiations about an oil exploration contract for BP in Libya. Six weeks after his change of heart, the deal was ratified.
In one of the letters, Mr Straw wrote: "I had previously accepted the importance of the al-Megrahi issue to Scotland and said I would try to get an exclusion for him on the face of the agreement. I have not been able to secure an explicit exclusion.
"The wider negotiations are reaching a critical stage and, in view of the overwhelming interests of the United Kingdom, I have agreed that in this instance the (prisoner transfer agreement) should be in the standard form and not mention any individual."
Liberal Democrat foreign affairs spokesman Ed Davey said the letters were the strongest evidence yet that the Government had been talking to the Libyans about Megrahi with a view to safeguarding Britain's commercial interests.