As Colonel Gaddafi’s power slowly ebbs away in Libya, many people will be worried that he is planning a brutal, bloody, finale.

Predicting the unpredictable dictator is a dangerous game.

But in mapping how the end game is going to play out, you could also play the blame game in how we got here.

And part of the blame must lie with Tony Blair and BP.

For years the man dubbed by Ronald Reagan the “mad dog of the Middle East” had been an international pariah.

This all changed in 2004. Gaddafi’s ‘deal in the desert’ with Tony Blair sealed an agreement that brought the Mad Dog in from the cold.

The deal was simple: Libya would halt terror attacks in return for western help in extracting oil reserves.

The five second handshake between the two men was meant to signal the beginning of an age of cooperation where BP would get access to Libya’s lucrative oil reserves.

“You cannot exaggerate the role that Blair and Britain played in bringing Gaddafi in from the cold,” Professor Fawaz Gerges of the London School of Economics told the Financial Times at the weekend. “In 2004, Gaddafi was still a maverick – someone dismissed as an insane, babbling idiot by most serious people. By allowing Gaddafi to rebrand himself, Blair sacrificed principle at the altar of economic gain.”

And on the alter was oil. With 44.3bn barrels of proven reserves, Libya has more oil than any other African country, four times as much as Britain and Norway combined.

A confidential UK government document recently declares that Libya is one of the few countries “with medium-term capacity to bring significantly more energy to world markets”.

For BP, the hand-shake was huge. It paved the way for the company to go back into the country. In 2007, it agreed to invest $900m in a deal to explore Libyan fields.

As Tony Hayward, then chief executive, said at the time, this was BP’s “single biggest exploration commitment anywhere in the world”.

Hayward added “We are delighted to be working with the National Oil Company of Libya to develop their natural resources for domestic and international markets. Our agreement is the start of an enduring, long-term and mutually beneficial partnership with Libya.”

BP was banking on Libya for its future commercial success. This “mutually beneficial” relationship allowed Blair and BP to prop up the unpredictable dictator, who is now using helicopter gun-ships and foreign mercenaries to murder his own people.

Gaddafi’s government even went as far as to exert pressure on oil companies such as BP to reimburse Tripoli the $1.5 billion Libya had paid in 2008 into a fund to settle terrorism claims from the 1980s.

And talking of terrorism, we now know BP lobbied the British government in late 2007 over a prisoner transfer agreement with Libya prior to the release of Lockerbie bomber Abdel Baset al-Megrahi.

Meanwhile senior officials in Blair’s government are unrepentant about dealing with Gaddafi.

Ex-Foreign Secretary Jack Straw argues that “Libya has oil and so do other countries whose regimes we would not voluntarily choose. The world needs energy and the simple truth is that if we had been more fastidious in our approach, then other countries – notably China – would have moved in to take our place.”

Many would argue that this line is morally and ethically bankrupt. The “I had to do it otherwise the Chinese would” is no excuse for helping prop up a dictator in the name of oil.