Gaddafi's remarkable rehabilitation

The return to Libya of the Lockerbie bomber would mark another stage in the remarkable rehabilitation of Colonel Muammar Gaddafi and a regime formerly shunned by Britain and other western countries as a dangerous pariah. But relations with Tripoli remain tentative in other respects, with issues such as the 1984 murder outside the Libyan embassy in London of PC Yvonne Fletcher still unresolved.

Gaddafi can be expected to make political capital out of Abdelbaset al-Megrahi's release. September will see celebrations marking the 40th anniversary of the army coup – Gaddafi calls it a revolution – that overthrew King Idris. The Libyan leader will also chair an African Union summit and address the UN general assembly next month. The securing of Megrahi's return would boost Gaddafi's appetite for triumphalist showmanship.

In some ways Gaddafi has good reason for self-congratulation. In the 1980s he was locked in confrontation with the west, accused of supplying weaponry to the IRA, of bombing a Berlin discotheque packed with American servicemen, and of supporting Palestinian terrorism. In 1986 the Reagan administration, which dubbed him "Mad Dog Gaddafi", launched air strikes on Tripoli and Benghazi in an attempt to kill him. It was in the context of this undeclared war, also involving other radicalised Middle Eastern regimes including Iran, that the 1988 Lockerbie attack occurred.

Gaddafi's revolutionary zeal seemed to cool in later years as Libya's isolated economic problems, exacerbated by UN sanctions, mounted. A turning point came in 2003 when Britain confronted him with proof of Libya's efforts to acquire nuclear weapons-related technology through back-door deals with the rogue Pakistani atomic scientist Abdul Qadeer Khan.

Gaddafi renounced his nuclear programme, opened Libya's facilities to inspection, and signalled a new era of collaboration with the west. In return, UN sanctions were lifted, Britain and other EU countries dispatched trade missions, focusing in particular on Libya's under-developed oil industry, and in 2004, Tony Blair met Gaddafi in a tent in Tripoli and offered him "the hand of friendship".

Relations have steadily improved since then. Both Gordon Brown and Barack Obama met Gaddafi on the periphery of last month's G8 summit in Italy. Downing Street said the Megrahi case and Yvonne Fletcher's murder were discussed. The abduction from Wigan of six-year-old Nadia Fawzi by her Libyan father was also on the agenda. Overall, Brown and Gaddafi agreed the bilateral relationship was "strong" and "would grow still stronger", British officials said.

A key driving force behind this steady rapprochement is growing British business interest in Libya. BP has invested roughly $1bn in oil and gas exploration there while other oil majors and EU governments, notably France, are also in on the act. Britain is already supplying missiles and air defence systems to Tripoli under a 2007 agreement.

Some relatives of the Lockerbie victims, especially in the US, believe these growing business and commercial links have overly influenced the government's response to Gaddafi's request for Megrahi's release.

Leading a business delegation to Libya last year, Lord Digby Jones, Britain's then trade and investment minister, described the country as an exciting emerging market.

"The vital oil and gas sectors are the mainstay of Libya's economy. BG, Shell and BP are working hard and productively with Libya's National Oil Corporation," Digby Jones said. Business opportunities for British companies in key sectors including financial services, defence, aviation, ports and airports were also being explored, he said.

Speaking last month at a Libya investment conference in London supported by the government, Mahmud al-Ftise, the country's privatisation and investment secretary, said Tripoli expected to attract $2bn in new foreign direct investment and a further $2.7bn in investment in the downstream oil industry. "This number is humble but we are really relaxed … Libya has very big potential," Ftise said.

Serious differences with Libya remain despite warmer ties. In addition to the Yvonne Fletcher case, these include unsettled compensation claims for the Lockerbie families, Gaddafi's eclectic, undemocratic, style of governance, and Libya's human rights record. In June Amnesty International expressed concern about Libya's alleged collusion with Italy in the mistreatment of economic migrants and asylum-seekers.

Simon Tisdall, an assistant editor of the Guardian and a foreign affairs columnist.