(Bloomberg) -- Russia’s industrial sector recorded the smallest contraction in four months in the latest sign the economy is adapting to the sweeping sanctions imposed by the US and its allies for the Kremlin’s invasion of Ukraine.

Industrial production fell 0.5% in July, less of a drop than the 2.3% expected by analysts in a Bloomberg survey and the best performance since the first months of the war. On a seasonally adjusted basis, output was up from the previous month for the first time this year, according to data released by the Federal Statistics Service.

Increased mining and oil-product output, along with rebounds in sectors like pharmaceuticals, semiconductors and clothing that have benefited from the exodus of foreign competitors since the war began, contributed to the stronger-than-expected performance. 

Sanctions and the departure of many foreign companies have hit Russia’s economy, but the impact hasn’t been as deep as many feared at the start of the war. Overall, the economy contracted 4% in the first half and the central bank is forecasting a drop of 4-6% for the year. 

“Mining is running ahead of the rest but that’s to be expected,” said Renaissance Capital economist Sofya Donets. “But manufacturing is also showing improvement above expectations.”

Even the auto sector, which had all but shut down in recent months as the foreign companies that dominated the sector fled, showed some tentative signs of steadying, with output down only 58% in July compared to -66% in May. Local producer Avtovaz said Wednesday it would resume five-day-a-week production next month, Tass reported. 

But some economists saw reason for caution in the latest industrial-output report. “First, the July improvement in manufacturing seem to be localized in oil downstream and metals production, i.e. related to commodities,” said Dmitry Dolgin, economist at ING. “Second, the estimate for 1H22 was nearly halved from +2.0% YoY to +1.3% YoY, mainly on lower estimate for the commodities extraction sector.”

What Bloomberg Economics Says...

“Industrial output expanded by 1.2% compared to last month. Passenger-car manufacturing remains a shadow of its former self, but output is gradually edging up. Overall, the report confirms our above-consensus call of a shallow 3.5% GDP contraction.”-Alexander Isakov, Russia economist.

In August, business sentiment slipped a bit amid problems with imported supplies and labor, according to a central bank survey released Wednesday. But optimism remained about the outlook, with many companies expecting growth.

In the oil sector doubts linger about the coming months, especially as Europe prepares to impose new restrictions on sales of Russian oil, a vital export.

“We expect the trends to worsen in late 2022 and early 2023, particularly amid of the implementation of the European Union’s oil embargo,” Donets said.

(Updates with analyst comment in seventh paragraph)

©2022 Bloomberg L.P.