David Cameron has been operating a secret unit in Whitehall charged with undertaking covert economic operations to choke the Gaddafi regime of the one thing it had in abundance: oil.

The "Libyan oil cell" was run by the international development minister Alan Duncan and helped to strengthen sanctions against the oil-rich country, blocking supplies of crude oil to the dictator's side while allowing petrol and diesel to flow to the rebels.

But the government is likely to face intense scrutiny over the fact that the unit was involved in linking the rebels to a Swiss oil firm, Vitol, which has been credited with keeping the revolutionary engine running through the war. Duncan was previously a consultant with the firm and has close personal ties to its chairman, Ian Taylor. Taylor has also been a Conservative donor in the past.

The unit was backed by Cameron and William Hague, the foreign secretary, and involved half-a-dozen officials with help from MI6. It was tasked with working out how to control the flow of oil in and out of the country. Sources close to the project claim that in the last weeks of the dictatorship, Gaddafi struggled to keep his forces on the move with his refined oil stocks depleted by 90%, while rebels gathered momentum as they began to trade the nation's crude for refined petrol and diesel.

A Whitehall source said: "We have, as a British initiative, driven the entire significance of oil as the most crucial non-lethal weapon in this conflict. The energy noose tightened around Tripoli's neck. It was much more effective and easier to repair than bombs. It is like taking the key of the car away. You can't move. The great thing is you can switch it all back on again if Gaddafi goes. It is not the same as if you have bombed the whole city to bits."

The cell's links with Vitol are likely to trigger controversy, although it is understood that Vitol also had an existing relationship with the rebels and had chosen to back them over Gaddafi early in the conflict. Civil servants raised concerns about the possibility that the government was moving too far into commercial territory, although a Whitehall source told the BBC there was no conflict of interest because the Libya oil cell had no commercial relationship with the company.

Duncan praised the firm for taking the risks in supplying a country at war, and insisted the government played no role in the commercial relations between the two. "We were not awarding contracts or encouraging [the rebels] to take sides. Vitol has always been the supplier, but equally it could have been BP and Shell but they were the only ones prepared to take the risk," he told the Times.

He denied setting up meetings personally. "Very strict procedures were set up. I would never meet anyone from the oil sector without officials there … You can draw a link but it's a very small business, the oil business."

While Libya has crude oil in abundance, it has always relied on imports of refined products. Only one refinery, in Zawiya, was in operation during the conflict. But in April the sanctions regime was failing, with refined oil being smuggled across the Tunisian border. The sanctions also appeared to be to the disadvantage of the rebels more than Gaddafi's regime, which was finding ways to circumvent it.

From June, the oil cell's elaborate schemes involved deploying Nato operations to block ships bringing the dictator refined oil, enforcing sanctions on exports, and a naval chase of the Cartegena, a Libyan-owned ship which attempted to unload thousands of tonnes of fuel in Tripoli and ended up in a stand-off outside Malta. "The fact is that three months ago if we had not intervened on the oil side and made the NSC [national security council] and Nato and coalition partners understand this there would have been a massive reversal of fortune. The east would have run out of fuel and money and Gaddafi would have kept going," a Whitehall source claimed.