Petroleos Mexicanos posted a surprise quarterly loss, in stark contrast to the huge profits reported this week from its biggest international peers, due to a depreciating peso and the higher cost of importing fuel.

Pemex said Friday it had third-quarter net loss of 52 billion pesos ($2.62 billion), compared with record earnings of 131.5 billion pesos in the second quarter. Its crude oil and condensate production reached 1.764 million barrels a day, a slight increase compared with the second quarter. 

The cost increase is due to rising prices for “gasoline, diesel, jet fuel and natural gas, as well as the increase in sales volume of regular gasoline, premium gasoline, diesel and jet fuel,” Pemex said in a filing to the Mexican stock exchange.

The disclosure comes the same day US oil giants Exxon Mobil Corp. and Chevron Corp. reported that they amassed more than $30 billion in combined net income last quarter amid high prices for crude and natural gas. Other energy majors including Shell Plc and TotalEnergies SE reported record or near-record earnings this week, spurring additional cash returns to shareholders via enhanced dividends and stock buybacks.

But unlike those companies, Pemex’s role as government-controlled national champion limits its ability to full capitalize on the global squeeze on energy supplies. Although Mexican President Andres Manuel Lopez Obrador has promised to rescue the company by restoring much of its former monopoly in the oil sector, he’s also diverting its resources into ramping up an unprofitable refining business with a goal of making Mexico self-sufficient in fuel. 

At the same time, Pemex is importing more gasoline and diesel. Older technology and a lack of maintenance means the company’s existing refineries are mostly producing fuel oil. Pemex reported a negative refining margin -- meaning it lost money on making fuel -- in the third quarter on lower crude prices and competition from refineries worldwide boosting their processing rates.

Output from giant onshore fields Ixachi and Quesqui has helped boost sales of natural gas and condensate, which is similar to very light crude. Even so, Pemex’s flagship oil for export continues to decline.

Pemex’s construction of the Olmeca, or Dos Bocas, refinery in Tabasco state and its purchase of the Deer Park refinery in Texas have resulted in cost overruns. With the highest debt of any oil company, Pemex has struggled to pay the billions of dollars it owes to its offshore oil suppliers and contractors. 

Pemex is seeking about $1 billion in financing from HSBC and Goldman Sachs Group Inc. in a deal that will tie funds to reducing greenhouse gas emissions, Bloomberg reported last month. The company has said in a presentation that it is looking for new financing schemes to monetize receivables for gasoline and diesel.