Harold Wilson wrote to Colonel Gaddafi in 1975
The government offered Libya £14m in the 1970s as part of a deal to end its support for the IRA, it has emerged.
Documents released by National Archives have details of Harold Wilson's Labour government in negotiations to halt the supply of weapons from Tripoli.
Mr Wilson's offer was part of a wider deal to settle financial claims against the UK and end "discrimination" against British goods.
Documents include a "personal message" from Mr Wilson to Colonel Gaddafi.
In 1975, Mr Wilson wrote: "I do not want to anticipate the results of the forthcoming talks, which we shall enter into in a truly constructive spirit, but it might be helpful nevertheless to mention two questions of particular importance to us.
"The first of these concerns Northern Ireland."
Two years earlier, a ship laden with Libyan guns and ammunition destined for the IRA, the Claudia, was apprehended off the Irish coast.
The Foreign Office documents suggest discussions continued under Mr Wilson's successor James Callaghan.
A classified Foreign Office minute from January 1977 stated: "Over the last 18 months we have negotiated on the basis of an offer by HMG of an ex gratia payment of £14m to the Libyans if they will drop their £52m claims against HMG (Her Majesty's Government), end their residual discrimination against British goods, settle private UK and MoD claims on them and cease any kind of support for the IRA."
However by the end of the decade, diplomats were acknowledging the policy had failed.
British ambassador Donald Murray wrote from the Libyan capital Tripoli: "HMG made a genuine ex gratia offer in order to improve relations, even though they had no call to do so. It has been categorically rejected.
"There is still discrimination against our bilateral trade.
"Despite the discussion which Colonel Gaddafi had with HM ambassador in October 1975, there is no indication that the Libyan government wants to understand our problem on Ireland and we are now invited to interpret Libyan government policy from nothing more substantial than one remark which Colonel Gaddafi made to an American journalist."
The first arms connection with Libya was discovered in 1973 when the Claudia was stopped.
Colonel Gaddafi has said he resumed contact with the IRA in 1986 after the UK assisted the US in bombing Tripoli.
It is believed that three substantial shipments of arms reached Ireland before the French authorities apprehended a ship, the Eskund, laden with some 150 tonnes of weaponry.
It was carrying about 1,000 AK-47 machine guns, one million rounds of ammunition, more than 50 ground-to-air missiles and two tonnes of the powerful Czech-made explosive, Semtex.
Semtex supplied by Libya became the IRA's most devastating and infamous weapon.