Hundreds of Venezuelans found themselves stranded this week as the nation’s gasoline supply ran out at stations throughout the nation’s urban centers, a stunning development in an OPEC nation believed to boast the world’s largest oil reserves.

According to the newspaper El Nacional, one-third of Venezuela’s 24 states – Miranda, Aragua, Lara, Barinas, Anzoátegui, Nueva Esparta, Bolívar, and Monagas – have reported significant shortages in gasoline for sale in stations throughout their cities. Hundreds of cars have been stranded on long lines at gas stations or in the middle of streets on their way to gas stations, distorting traffic flows and generally preventing city traffic from flowing smoothly.

Venezuelans speaking to media outlets expressed confusion and frustration at their inability to find a properly stocked gas station. “I have been to four or five gas stations and it has been impossible to fill my car,” José Torres of Caracas told reporters after finally finding one open gas station.

“Yesterday, I went to three filling stations and I couldn’t fill my tank,” student Freddy Bautista said on Thursday. “I’ve been waiting 30 minutes here, and it seems like I’ll be able to fill up today,” he added, in front of a gas station in east Caracas.

While Venezuela is naturally gifted with ample oil reserves – an estimated 298 billion barrels – its oil is extremely thick and requires extensive refining before being able to be sold as fuel. Venezuela’s socialist government relies on foreign entities to do the refining.

This only goes so far to explain the sudden shortage, however. The Venezuelan state oil corporation, Petróleos de Venezuela (PDVSA), has also experienced a collapse in oil output under dictator Nicolás Maduro. According to the newspaper El Carabobeño, the government issued a statement claiming that the reason for the shortage was that weather delays had kept oil shipments from abroad from being promptly distributed throughout the country between Monday and Tuesday.

The newspaper refutes the claim, arguing that the shortage began to be noticeable Friday of last week: “within PDVSA there was knowledge that they could only bring to market 40,000 barrels of oil to meet a demand of 260,000 barrels weekly.”

The real culprit, according to a Reuters investigation, is Maduro’s policy of exporting, often for very little profit or none at all, a significant percentage of Venezuela’s oil output to allied nations. Countries who support Venezuela’s socialist government internationally – including Cuba, Nicaragua, and other Latin American states – receive Venezuelan oil at significantly discounted prices.

While Cuba has traditionally been the greatest beneficiary of this program, the decline of the Venezuelan economy forced Maduro to reduce shipments of oil to Havana by half in 2015 and raise prices slightly. Cuba traditionally pays for this oil with support on international stages like the United Nations and by deploying “volunteer” doctors to work on meager stipends in the allied nation. Other recipients of Venezuelan oil, like Jamaica, began to pay their debts with food supplies as shortages began to expand to nearly every market in Venezuela.

According to PDVSA documents obtained by Reuters, the oil corporation increased its exports by 22,000 barrels per day last month to meet the demands of its allies. While expanding the amount of oil it was shipping to the international community, PDVSA ran out of money to pay for the refined oil it is forced to import from abroad.

Reuters claims “about 10 tankers are waiting near PDVSA ports in Venezuela and the Caribbean to discharge fuel for domestic consumption and for oil blending.” Whether Venezuela can afford the $20 million per cargo it owes in order to stop the shortage from causing chaos on Venezuelan streets remains unknown. Venezuelan officials have refused to sell the imported oil at market value as a means of keeping their popularity with poorer Venezuelans, putting strain on the nation’s coffers.

PDVSA’s books also fail to add up, according to legislators in the Venezuelan National Assembly. An October report published by the legislative body found that $11 billion in PDVSA assets had gone “missing” in the past decade, with no record of how they were spent.

“There is no inventory, the situation is increasingly serious,” Iván Freites, an oil union leader, told reporters this week. According to Freites, the country is producing 40,000 barrels of gasoline a day when it has the capacity to refine 104,000 barrels a day.

Freites also told media this week that, by his calculations, 77 oil refineries are “paralyzed,” unable to function due to PDVSA’s debts, leaving it unable to manage the refineries, as well as general government mismanagement. He estimates the nation is producing only one third of what it has the capacity to.

Venezuela imports $700 million worth of gasoline a year, according to legislator José Guerra, from a variety of countries, including the United States.