In the spring of 1959, at a secretive meeting at a yacht club in Cairo, Venezuela’s then-minister of mines and hydrocarbons, Juan Pablo Pérez Alfonso, hatched a plan to give big oil-producing countries more control over their black gold — and a greater share of the wealth it promised to create. A year later, his scheme would be formally christened the Organization of the Petroleum Exporting Countries, or OPEC. Venezuela, which sits atop what are arguably the biggest petroleum reserves in the world, was the only non-Middle Eastern country to be included — a testament to its importance to the global oil business.

Venezuela was considered rich in the early 1960s: It produced more than 10 percent of the world’s crude and had a per capita GDP many times bigger than that of its neighbors Brazil and Colombia — and not far behind that of the United States. At the time, Venezuela was eager to diversify beyond just oil and avoid the so-called resource curse, a common phenomenon in which easy money from commodities such as oil and gold leads governments to neglect other productive parts of their economies. But by the 1970s, Venezuela was riding a spike in oil prices to what looked like a never-ending economic bonanza. Complemented by years of stable democracy, it seemed a model country in an otherwise often troubled region.

Such success makes the sorry state of Venezuela’s oil industry today, not to mention that of the country at large, all the more surprising — and tragic. The same state that, six decades ago, dreamed up the idea of a cartel of oil exporters now must import petroleum to meet its needs. Crude production has tanked, hitting a 28-year low last fall when it dipped under 2 million barrels a day. “I don’t think we’ve ever seen a collapse of that magnitude [anywhere] without a war, without sanctions,” said Francisco Monaldi, a Latin America expert at Rice University’s Baker Institute for Public Policy.

The combination of plummeting oil revenues and years of government mismanagement has virtually killed off the country’s economy, sparking a humanitarian crisis that threatens to engulf the region.

Venezuela has not, of course, fought a war in recent years. But the combination of plummeting oil revenues and years of government mismanagement has virtually killed off the country’s economy, sparking a humanitarian crisis that threatens to engulf the region. Caracas refuses to track inflation (or at least publish its findings), but the National Assembly calculates the annual rate to be more than 4,000 percent, and the International Monetary Fund predicts it could hit 13,000 percent this year. Given how much prices have already risen since January, the real number could be 10 times higher.

[soundcloud url=”https://api.soundcloud.com/tracks/470820393?secret_token=s-d47kP” params=”color=#ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true” width=”100%” height=”166″ iframe=”true” /] Listen to this story and other feature stories from FP and other magazines: Download the Audm app for your iPhone.

Venezuela’s murder rate, meanwhile, now surpasses that of Honduras and El Salvador, which formerly had the world’s highest levels, according to the Venezuelan Violence Observatory. Blackouts are a near-daily occurrence, and many people live without running water. According to media reports, schoolchildren and oil workers have begun passing out from hunger, and sick Venezuelans have scoured veterinary offices for medicine. Malaria, measles, and diphtheria have returned with a vengeance, and the millions of Venezuelans fleeing the country — more than 4 million, according to the International Crisis Group — are spreading the diseases across the region, as well as straining resources and goodwill.

What explains the country’s precipitous decline from being one of Latin America’s richest and most stable states? Mark Green, the head of the U.S. Agency for International Development, blames President Nicolás Maduro — who, in May, won another six-year term in elections widely denounced as fraudulent — and his “delusional” policies. But while there’s no question Maduro is partially culpable, to fully understand how a country blessed with the world’s biggest oil endowment could end up so crushingly poor requires going much further back. The fuse for the bomb that is now blowing up Venezuela’s oil industry — and the country along with it — was deliberately lit and fanned by Maduro’s predecessor and mentor, the strongman Hugo Chávez, not long after he swept into power in the late 1990s.

The decline and fall of Venezuela’s oil industry essentially begins with its nationalization in 1976, a time of booming crude prices and rising resource nationalism. President Carlos Andrés Pérez sought a much greater role for the state over the economy and especially wanted to use the country’s fast-growing oil wealth to turbocharge development. That year, to gain full national control over the oil fields, Caracas banished foreign oil firms and created a new, state-run oil monopoly called Petróleos de Venezuela (PDVSA). The moves marked the capstone to Pérez Alfonso’s decades-long dream of Venezuela grabbing full control of its destiny. It was also the logical outcome of the widely held belief that the country’s oil, discovered in 1922 on the shores of Lake Maracaibo, was national patrimony.

At first, Venezuela’s state-owned oil company stood out from peers such as Petróleos Mexicanos in many ways. A large number of its executives, for example, had previously worked for foreign companies in the country and imbued the new firm with a business-oriented outlook and a high degree of professionalism. PDVSA had a lean workforce, an efficient cost structure, and a global outlook: A decade after its creation, the company acquired half of Citgo, the big U.S. refiner, and stakes in a pair of European refineries.

Yet none of these assets proved much help when a global oil glut in the mid-1980s depressed prices and hammered the national economy. OPEC members struggled to prop up prices by cutting back output. By the middle of the decade, Venezuelan production had fallen below 2 million barrels a day, or about 50 percent less than during the heyday right before nationalization.

When oil is cheap, it becomes very tempting for countries to pump more crude — even if that extra production ends up keeping prices low. And so, to right the reeling Venezuelan economy in the early 1990s, the government sought to reopen the oil industry to international companies. The outsiders would be especially useful in accessing Venezuela’s mother lode, the Orinoco heavy oil belt, which holds more than a trillion barrels of tarlike bitumen. Unlike regular light crude oil, which can be pumped straight out of the ground and sold as is, heavy oil is more difficult to extract and then needs to be upgraded to something resembling liquid oil before sale. Doing all that takes the kind of cash and sophisticated know-how PDVSA lacked at the time.

By the mid-1990s, international firms, including Chevron and ConocoPhillips, had moved back into the country and were hard at work unlocking Venezuela’s massive heavy oil deposits. But in 1998, the price of oil collapsed again, dipping to $10 a barrel. The impact on Venezuela — which, like many oil-rich countries, had never managed to diversify its economy despite a bout of reform efforts in the 1970s — was severe, given that petroleum exports then represented about one-third of the state’s revenues. Then along came Chávez, a former army lieutenant colonel who’d served time in prison for an abortive coup attempt in 1992. He won the 1998 presidential election on the promise to reshape and restore Venezuela’s reeling economy.

Among his first targets: the technocrats at PDVSA, especially the company’s deeply knowledgeable then-chairman and CEO, Luis Giusti, who’d led the drive to reopen the country’s oil sector. “Chávez saw Giusti as a potential rival. In fact, Chávez used the slogan ‘PDVSA is part of a state within a state,’” said Juan Fernández, a former PDVSA manager who would also fall afoul of the strongman. Giusti, alarmed by Chávez’s plans for the oil company, resigned just as he took office in early 1999; he was then replaced by a revolving cast of political appointees. The departure of Giusti, who’d spent three decades in the Venezuelan oil business and had won international plaudits for overhauling and modernizing the state-run firm since taking over in 1994, would prove to be bad news for PDVSA’s fortunes.

Chávez’s goal was to exert control of PDVSA and maximize its revenue, which he needed to fund his socialist agenda. But achieving the latter required cooperating with the rest of OPEC, which, as in the 1980s, wanted to cut production in order to raise prices. The problem for Chávez was that many of the PDVSA’s then-managers wanted to increaseproduction, by continuing the development of Venezuela’s technically challenging heavy oil fields. To do so, they needed to reinvest more of the company’s earnings rather than hand them all over to the government. So the managers had to go.

Unfortunately for Venezuela, Chávez — like many of the people he appointed to run PDVSA — knew nothing about the business that was so central to the country’s prosperity. “He was ignorant about everything to do with oil, everything to do with geology, engineering, the economics of oil,” said Pedro Burelli, a former PDVSA board member who left the company when Chávez took power. “His was a completely encyclopedic ignorance.”

“[Chávez] was ignorant about everything to do with oil, everything to do with geology, engineering, the economics of oil,” said Pedro Burelli, a former PDVSA board member who left the company when Chávez took power. “His was a completely encyclopedic ignorance.”

But Chávez wasn’t the type to let that stop him. In 2001, the former paratrooper pushed through a new energy law that jacked up the royalties foreign oil firms would have to pay the government. It also mandated that PDVSA would lead all new oil exploration and production; foreign firms could only hold minority stakes in whatever partnerships they struck with the national company.

In 2002, Chávez took two more steps to turn the once-proud PDVSA into his private preserve. First, he installed a new president, Gastón Parra Luzardo, a leftist economics professor who was a fierce opponent of opening the industry to more private investment. Then, in April, he went on live television to humiliate and fire a handful of PDVSA managers, replacing them with political hacks. Together, the moves sparked violent public protests, which turned into a coup attempt against Chávez.

The president survived the putsch, but his popularity plummeted — especially inside PDVSA. By the end of 2002, opposition to Chávez had solidified, and big labor groups called for a national strike in hopes of pressuring him to leave office. Oil workers backed the effort, setting the stage for what would turn out to be the critical step in PDVSA’s road to ruin.

During the two-month work stoppage, PDVSA’s output plummeted as field workers stopped pumping and tanker crews refused to leave port. Venezuela’s oil production fell from close to 3 million barrels a day before the strike to levels as low as 200,000 barrels a day in December 2002.

Crucially for Chávez, however, the international oil companies refused to join the protest. “The multinationals kept producing during the strike,” said Monaldi of Rice University. “That is what saved him,” by blunting the economic impact of the protest.

Chávez immediately fought back. During the strike, he axed scores of senior executives, including Juan Fernández, one of the organizers of the protest. In the months that followed, the pink slips kept coming, and by the time the smoke finally cleared, Chávez had fired more than 18,000 workers. With them went most of the managerial expertise and technical know-how PDVSA had managed to preserve during the earlier purges.

This evisceration of the PDVSA’s human capital would prove the most damaging of Chávez’s many moves against the company. Even his own government soon realized the harm it had done. Accidents and spills began to proliferate, and in 2005, a top energy ministry official admitted privately that it would take at least 15 years to rebuild the technical skills lost by the mass firings. Another energy ministry official even asked U.S. diplomats in Caracas to help arrange training in the United States. And in the years since, the situation has only worsened. Conditions at the company (and in the economy) are now so bad that employees take home a pittance — just a handful of dollars a month — and face political pressure to support the regime. Such treatment has led to the large-scale flight of skilled workers: more than 25,000 since last year, union officials say. According to Reuters, the exodus has grown so big that some PDVSA offices have begun refusing to let their workers resign.

“PDVSA was one of the best. They really knew how to operate,” said one executive at an international oil company with long experience in Venezuela. “The purge massively screwed them over, bled them of guys who knew what they were doing on so many levels. And they’ve never recovered.”

While some of his underlings clearly understood the havoc he was causing, Chávez either didn’t know or didn’t care; determined to finance his ongoing socialist revolution and use cheap exports to buy friends abroad, he kept turning the screws on the oil industry. Using legally questionable methods, he started siphoning off billions of dollars in PDVSA revenue to pay for his social programs, including housing, education, clinics, and school lunches. While this strategy may have paid off politically in the short term, it was extremely dangerous: for the more cash the government took out of PDVSA, the less money the oil company had to invest in maintaining production or finding new resources. Since oil fields gradually produce less oil over time as they get tapped out, countries constantly need to dig new wells and rejuvenate shrinking reservoirs with injections of water or gas. Thanks to their geology, Venezuela’s oil fields have enormous decline rates, meaning the country needs to spend more heavily than other petrostates just to keep production steady. But as Chávez channeled more income into other areas, PDVSA was forced to mortgage the future to pay for the political present.

[Maduro’s autocratic regime is going after María Corina Machado because she is fearless and incorruptible. She needs Washington’s support.]

In 2005, Chávez once again turned on the foreign firms. He raised royalty rates yet again and billed the companies for billions of dollars in bogus back taxes. Then he began forcing foreign companies to cede the bulk of their operations to PDVSA, a process U.S. Embassy officials described at the time as “creeping confiscation.” Every year, “Chávez systematically did something” to the international firms, “whether raising their taxes or forcing them to sell oil for local currency,” Monaldi said. These provocations exasperated foreign executives; even officials from the China National Petroleum Corporation grumbled to U.S. officials about Caracas’s interference. ExxonMobil and Conoco threw in the towel and left. (This spring, Conoco finally won a $2 billion arbitration award against PDVSA for the expropriation of its assets.) Yet many others, such as Chevron, found Venezuela’s gargantuan potential so tempting that they accepted the punishing new terms.

Despite the presence of these holdouts, Chávez’s increasingly erratic behavior further reduced the investment needed to get the heavy oil out of the ground. So did the government’s use of PDVSA’s revenue to fund social programs and to pay off Venezuela’s sovereign debts. “During the highest oil boom in history, when every other country in the world increased investment, Venezuela did not, and production kept declining,” Monaldi said.

For all Chávez’s abuses and mistakes, Venezuela’s oil industry managed to stagger along for a surprisingly long time. Production held virtually steady from 2002 (just before the strike) to 2008, when global oil prices peaked at almost $150 a barrel. That year, Venezuela earned about $60 billion from oil. (These production numbers come from OPEC; the government’s own estimates are higher and viewed skeptically by the rest of the industry.)

The higher prices more than made up for the slight decline in production — between 2002 and 2008, Venezuela’s output fell from 2.6 million barrels a day to 2.5 million — allowing Chávez to keep spending and masking the need for a major overhaul of the industry. But even high crude prices couldn’t hide the deeper economic dysfunctions caused by Chávez’s efforts to build what he called “21st-century socialism.” Shortages of common consumer goods became endemic. A country that was once an exporter of agricultural products had to start importing lots of government-subsidized food — another common feature of the resource curse. “In 2007, there were already intermittent shortages,” said Patrick Duddy, who served as U.S. ambassador in Caracas from 2007 to 2008 and again from 2009 to 2010. “There was, at times, no milk of any sort on the store shelves, not fresh, not powdered, not condensed — and this was when oil prices were soaring. It was startling.”

Increasingly desperate, the government soon found yet another way to strip-mine PDVSA: by using whatever management expertise it had preserved to run other parts of the economy that were breaking down. By 2007, for example, PDVSA had been dragooned into producing and distributing milk; later, the firm began importing other basic foods, from cooking oil to rice and beans. The company’s work in these areas may have provided the country with some short-term relief, but it further distracted PDVSA from what should have been its core business.

Caracas’s bid to nationalize the oil industry and assert its sovereign rights to the country’s black gold has all but ensured that less and less of that wealth will be left for Venezuelans.

Reality finally came crashing down in the summer of 2014, about a year after Chávez died from cancer and was succeeded by Maduro. Oil prices collapsed from a high of more than $100 a barrel in the summer to less than half of that by January 2015. By the end of that year, Venezuelan oil was selling for less than $30 a barrel, even as the budget was predicated on prices of $60 a barrel. By this point, Venezuela had become nearly wholly dependent on oil revenues, which made up about 95 percent of its export earnings. Cheaper oil tipped the economy into recession in 2014 and a full-blown crisis in 2015, with GDP shrinking by almost 6 percent and inflation exploding. And because Venezuela had neglected to diversify its economy, the country was out of options.

The one relative bright spot in Venezuela’s oil industry today is the superheavy Orinoco fields, jointly operated with foreign firms since the 1990s-era opening of the sector. Crude production in the Orinoco actually grew during the first half of this decade, and even now production declines have been modest. That’s a sharp contrast to steep output declines at traditional oil fields solely operated by PDVSA. But even the superheavy fields are struggling to keep production levels close to steady. Before it can export the heavy bitumen, PDVSA needs to blend it with light oil, and since at least 2010, Venezuela’s own light oil production has been falling. That forces the state energy company to spend much-needed cash importing light oil. Venezuela also imports gasoline — which it gives away to consumers for a paltry 4 cents a gallon. And it loses money when purchasers reject its cargoes of crude oil for their poor quality, an increasingly common problem. In other cases, it doesn’t even get paid: While the country now sends China 400,000-odd barrels a day, for example, Beijing considers them repayment for Caracas’s debts. Meanwhile, despite the collapse of its oil industry, Venezuela continues to buy foreign oil to ship, at a loss, to the regime’s ideological cousins in Cuba — a bitter legacy of Chávez’s plan to use Venezuela’s oil riches to buy friends in the neighborhood.

[Guyana just discovered it owns enough oil to solve all its problems — and cause even bigger ones.]

All these problems cost PDVSA — and Venezuela — huge amounts of cash. Selling oil at a discount, shipping it off to China (and Russia) to pay off the national debt, and subsidizing Venezuelan drivers cost the company, and the country, more than $20 billion a year, Monaldi estimated. Among other things, this massive shortfall has made it increasingly difficult for PDVSA to pay service companies such as Halliburton and Schlumberger, which help it drill for oil. Last year, the two companies wrote off more than $1.5 billion in unpaid bills owed by PDVSA. And since they’re not getting paid, they’ve slowed their work on the mature oil fields that were once Venezuela’s livelihood. That means even less light oil — which makes all the industry’s other problems even harder to solve.

That toxic mix collided last year, when production suddenly collapsed by 30 percent, marking a net decline of 2 million barrels a day since Chávez launched his plan to use Venezuela’s huge oil endowment to build a socialist paradise. The oil ministry now is reportedly bracing for a further fall during the rest of this year, to as low as 1.2 million barrels a day.

The only way Venezuela, which is broke and stripped of talent, can possibly fix its oil industry today is by relying more on foreign companies. Even if they were given a free hand, however, it’s not clear that international firms could turn things around anytime soon; the lack of investment in recent years hasn’t helped the health of Venezuela’s oil fields. “If you messed up the reservoir by overproducing or underinvesting, then you just can’t pick up where you left off,” the international oil company executive said. “They’ve probably done some long-term damage to the reservoirs.”

But Caracas seems unwilling to even test the proposition and continues doing everything it can to alienate the very businesses it needs so badly. In April, for example, government agents arrested two Chevron executives who reportedly refused to cooperate in overbilling for oil supplies. The two were held for months while facing possible treason charges, which carry a prison sentence of up to 30 years.

[Encouraging a coup in Caracas will give Russia and China a foothold in the United States’ backyard.]

Real reform would require a wholesale change in the country’s economic management: getting hyperinflation under control, establishing a stable and realistic exchange rate, and building an enforceable legal framework that could offer foreign investors some semblance of predictability and protection. Of course, it’s impossible to imagine Maduro doing any of those things, especially after recently winning (or stealing) another term. And his re-election carries additional short-term risks for the tottering Venezuelan oil sector. The United States is considering additional sanctions that could limit exports of U.S. crude and refined products to Venezuela or even ban the purchase of Venezuelan crude by U.S. refineries. Either move, or both, would deal yet another body blow to an industry already on its knees. What likely can’t be put back together again is the state oil company. “There is no money in the world that can bring that back,” Burelli said. “You might be able to rebuild an oil sector full of private players but not PDVSA.”

Ultimately, Caracas’s bid to nationalize the oil industry and assert its sovereign rights to the country’s black gold has all but ensured that less and less of that wealth will be left for Venezuelans. With no other vibrant economic sector, the only way to fund the government is by increasing oil production — which would require investing up to $10 billion a year for a decade, Burelli suggested — and the only way to attract that kind of investment is by offering international companies favorable terms. That means a bigger cut for them and a smaller cut for the state.

As Burelli put it, “To resurrect the oil sector, somebody will have to invest in it on their terms, not our terms, and that will not generate revenue. So, what will we live off?”

This article originally appeared in the July 2018 issue of Foreign Policy magazine.