The BBC has learned that David Cameron set up a secret unit within Whitehall to mount covert economic operations against Colonel Gaddafi.
The so-called "Libya oil cell" helped block fuel supplies to Tripoli while ensuring that petrol and diesel continued to get through to the rebels in the east.
Whitehall officials said the unit - made up of a handful of civil servants, ministers and military figures - played a crucial role in starving the regime's war effort of fuel while making sure that the rebels could continue taking the fight to Gaddafi.
The unit was the brain child of the international development minister, Alan Duncan.
The former oil trader convinced the prime minister in April that part of the solution to the conflict lay in oil. He persuaded the national security council that Gaddafi would defeat the rebels unless they got access to fuel and he was deprived of it.
So the secret cell was established in two discreet operations rooms in the Foreign Office where intelligence about oil and fuel movements was gathered and information and advice provided to the government and Nato.
The unit was headed up initially by a senior admiral, and then later by a senior government official, both of whom attended national security council meetings.
The cell advised Nato to blockade the port of Zawiya to prevent smugglers bringing in tankers full of fuel for Gaddafi's war effort.
They helped identify which oil tankers that Nato should interdict. They also helped locate other routes the smugglers were using to get fuel into Libya overland from Tunisia and Algeria.
The cell also provided intelligence to the rebels so they could cut off the supply of crude oil from the Nafusa mountains to Gaddafi's refinery at Zawiya.
'Tap turned off'
It also ensured that the sanctions regime against Libya was redrawn so that the rebels could get access to fuel from overseas.
And it encouraged London-based oil traders to sell fuel to the rebels in Benghazi by trying to minimise the risk they would take by having to wait for payment. It also ensured that the oil traders knew who to contact within the rebel hierarchy.
One Whitehall source said: "If you didn't have the fuel, you couldn't win the war. So our aim was to starve the west of fuel and make sure the rebels could keep going.
"Gaddafi had lots of crude but he couldn't refine it. So he had to rely on imported fuel. And we turned off that tap."
It emerged last night that Mr Duncan had once worked with Vitol, the oil company that provided fuel to the rebels. But Whitehall sources said there was no conflict of interest because the Libya oil cell had no commercial relationship with the company.
Mr Duncan was not available for comment.