Libyan leader Muammar Gaddafi is no doubt feeling victorious – and understandably so. In the week of the 39th anniversary of the revolution, he concluded two chapters in the history of his country’s troubled relations with the West.

A compensation deal with Washington may open the floodgates to greater investment from US companies. But more importantly for Gaddafi, the deal has officially ended his tenure as a political outcast and confirmed the international legitimacy of his regime.

The nod of approval from Washington did not cost him much. It is true that the vast majority of the funds required to settle claims by US citizens against Libya will come from Tripoli, but the estimated $2bn in reparations for acts of terrorism is a drop in the ocean for a country that reaps $40bn a year in oil revenues.

At the same time, and to ensure he did not lose face at home, Gaddafi chose his words carefully. While Tripoli has accepted responsibility for the bombing of Pan Am flight 103 over Lockerbie, it has not accepted guilt. The semantics mean he has done just enough for the US to feel satisfied, without having to go any further than he had to.

Gaddafi’s second victory came in the form of a deal under which Italy will pay $5bn as an apology for its colonial rule of Libya. As a result, Italian companies, like their US counterparts, will benefit from better access to business deals in the country.

With Gaddafi planning to completely restructure the mechanisms of government and encourage greater private sector participation in the economy, foreign companies will be eager to make the most of new opportunities.

For Gaddafi, it has all come at an easily affordable cost.