– After decades of dominating its oil industry, the Venezuelan government is quietly surrendering control to foreign companies in a desperate bid to keep the economy afloat and hold onto power.

The opening is a startling reversal for Venezuela, breaking decades of state command over its crude reserves, the world’s biggest.

The government’s power and legitimacy has always rested on its ability to control its oil fields — the backbone of the country’s economy — and use their profits for the benefit of its people.

But the nation’s authoritarian leader, Nicolas Maduro, in his struggle to retain his grip over a country in its seventh year of a crippling economic crisis, is giving up policies that once were central to its socialist-inspired revolution.

Under Venezuelan law, the state-run oil company must be the principal stakeholder in all major oil projects. But as that company, Petróleos de Venezuela, or PDVSA, unravels — under the weight of U.S. sanctions, years of gross mismanagement and corruption — the work is unofficially being picked up by its foreign partners.

Private companies are pumping crude, arranging exports, paying workers, buying equipment and even hiring security squads to protect their operations in a collapsing countryside, according to managers and oil consultants working on the country’s energy projects.

In effect, a stealth privatization is taking place, said Rafael Ramírez, who ran Venezuela’s oil industry for more than a decade before breaking with Maduro in 2017, in a video address last week.

“Today, PDVSA doesn’t manage our oil industry. Venezuelans don’t manage it,” said Ramírez.

PDVSA did not respond to requests for comment.

The haphazard changes to the oil sector, which have accelerated in recent months, are remaking the country’s oil industry.

And they are a stark retreat from the vision of Hugo Chávez, who was Maduro’s mentor and predecessor. Chávez nationalized in 2007 the giant holdings of Exxon Mobil and ConocoPhillips and packed PDVSA’s leadership ranks with political allies dedicated to his socialist-inspired “Bolivarian revolution.”

But Maduro’s transformation of Venezuela’s oil industry has stemmed the collapse triggered by a U.S. embargo. Sanctions imposed in January 2019 had wiped out about one-third of Venezuela’s oil production, bringing it down at one point to the lowest level since the 1940s, according to data from OPEC.

Oil production now is still less than one-third of the total in 1998, when Chávez took power. By late 2019, Venezuela had stabilized exports at about 1 million barrels per day, according to Bloomberg’s tanker-tracking data.

The dribble of oil exports has provided Maduro with foreign revenue at the most critical moment of the country’s economic crisis, allowing him to adjust to sanctions and consolidate his rule.

In the country’s main oil export hub, José, key processing plants and piers are slowly coming to life after near-total paralysis in the summer, when PDVSA was cut off from the global financial system and struggling to cope without its biggest market, the United States, according to shipping agents and oil managers.

The unofficial, partial privatizations have been led by Manuel Quevedo, a National Guard general with no known oil experience who was appointed by Maduro to head PDVSA.

Quevedo broke with the nationalist rhetoric of his predecessors to hand over operational control of joint oil projects to partners that include Chevron; Russia’s state-run company, Rosneft; some European and Chinese companies; and groups of Venezuelan magnates.

The concessions are reducing PDVSA to little more than a holding company collecting the state’s share of oil field revenue, with most financial and strategic decisions made by private partners.