“Libya is a kleptocracy in which the regime — either the al-Qadhafi family itself or its close political allies — has a direct stake in anything worth buying, selling or owning,” a classified State Department cable said in 2009, using the department’s spelling of Qaddafi.

The wealth that Colonel Qaddafi’s family and his government accumulated with the help of international corporations in the years since the lifting of economic sanctions by the West helped fortify his hold on his country. While the outcome of the military intervention under way by the United States and allied countries is uncertain, Colonel Qaddafi’s resources — including a stash of tens of billions of dollars in cash that American officials believe he is using to pay soldiers, mercenaries and supporters — may help him avert, or at least delay, his removal from power.

The government not only exploited corporations eager to do business, but willing governments as well. Libya’s banks apparently collected lucrative fees by helping Iran launder huge sums of money in recent years in violation of international sanctions on Tehran, according to another cable from Tripoli included in a batch of classified documents obtained by WikiLeaks. In 2009, the cable said, American diplomats warned Libyan officials that its dealings with Iran were jeopardizing Libya’s enhanced world standing for the sake of “potential short-term business gains.”

In the first few years after trade restrictions were lifted — Colonel Qaddafi had given up his country’s nuclear capabilities and pledged to renounce terrorism — many American companies were hesitant to do business with Libya’s government, officials said. But with an agreement on a settlement over Libya’s role in the Pan Am bombing over Lockerbie, Scotland, finally reached in 2008, officials at the United States Commerce Department began to serve as self-described matchmakers for American businesses.

At least a dozen American corporations, including Boeing, Raytheon, ConocoPhillips, Occidental, Caterpillar and Halliburton, gained footholds, or tried to do so. In May, the Obama administration and the Qaddafi government signed a new trade agreement, designed, according to Gene Cretz, the American ambassador to Libya, to “broaden and deepen our bilateral economic relations.”