Halliburton wrote off its remaining investment in Venezuela at a cost of $312 million on April 23, highlighting the decline of the crisis-hit nation’s oil industry.

Halliburton said it would continue to operate in the country “at a reduced level”, but would be careful about its future exposure. It last year wrote down $647million for late payment by PDVSA, Venezuela’s national oil company, and the fall in the value of a promissory note intended to cover some of those bills.

The problems faced by Halliburton, which provides essential services for oil production, are a sign of how Venezuela’s financial crisis and mismanagement have wreaked havoc in the country’s energy industry. The result is a downward spiral, in which weak revenues damage oil production, which then weakens revenues further.

Venezuela’s crude production has dropped 30% from 2.15 million barrels a day (MMbbl/d) in 2016 to 1.5 MMbbl/d last month. It is less than half its level when Hugo Chávez, the former president, was elected in 1998.

The decline in Venezuela’s production is one of the reasons why crude prices have risen by about 65% from its low point last June, in spite of surging output from the U.S.

Christopher Weber, Halliburton’s CFO, told analysts on a call on April 23 that the decision to write down its business in Venezuela had been prompted by the continued decline in the bolivar, changes in the foreign currency exchange system to end the dual exchange rate system, “ongoing political and economic challenges”, and U.S. sanctions.

The sanctions imposed last year did not directly target Venezuela’s oil industry, but do prevent U.S. individuals and companies buying or selling new debt issued by PDVSA, or any bonds issued by the Venezuelan government.

Schlumberger similarly wrote off its investment in Venezuela at the end of last year, taking a pre-tax write down of $938 million. It continues to operate a cash business in the country, but that has continued to decline into this year.

Paal Kibsgaard, Schlumberger’s CEO, said Venezuela’s oil production was in “free fall.”

The number of rigs drilling oil and gas wells in Venezuela dropped from 68 at the end of 2015 to 44 last month, according to Baker Hughes, a GE Company.

Although the rise in oil prices since last year has offered some help to Venezuela, the benefit has been muted because most of the oil PDVSA produces does not generate cash, according to Francisco Monaldi of the Baker Institute at Rice University.

He argued in a recent report that of the roughly 1.8 MMbbl/d that PDVSA produced last November, 400,000 bbl/d to 450,000 bbl/d were used in the domestic market at a huge loss, while about 500,000 bbl/d to 600,000 bbl/d were committed to repaying loans from China and Russia and owed to joint venture partners.