Pretax profits at Japanese companies in October to December fell 2.8 percent from a year earlier, marking the first decline in eight quarters, hurt by surging energy and raw material costs even as capital spending continued to grow in a positive sign for the economy, government data showed Thursday.

The decline was led by manufacturers dealing with chemicals, petroleum and coal, as they failed to fully pass on higher costs. But service providers continued to benefit from a pickup in demand for entertainment and travel since the lifting of anti-coronavirus curbs in Japan.

File photo taken on Jan. 13, 2021, shows Japan's Finance Ministry in Tokyo. (Kyodo)

The combined pretax profit of 22.38 trillion yen ($164 billion) for all sectors was the second highest for the October-December quarter as the global economy recovered from the COVID-19 economic fallout.

Both Japanese manufacturers and nonmanufacturers ramped up investment in the last three months of 2022, with capital spending -- a key gauge of domestic demand -- rising 7.7 percent to 12.44 trillion yen for the seventh straight quarter of increase, the data showed.

Firms in sectors like chemicals and metal products sought to boost production capacity, while service providers stepped up investment in new stores, according to the Finance Ministry.

"Capital spending has been on a recovery trend, which will likely continue. That said, the increase may be curbed by manufacturers, who will likely see slower growth in production and exports" reflecting weakening overseas demand, said Yoshiki Shinke, senior executive economist at the Dai-ichi Life Research Institute.

"Slower growth in overseas economies is also negative for manufacturers' pretax profits," he added.

Japan's economy rebounded in October to December from an unexpected contraction in the previous quarter, helped by a sustained recovery in private consumption despite a drop in capital spending.

Thursday's data will be reflected in revised gross domestic product figures scheduled for release on March 9.

"The Japanese economy has been recovering moderately. We will keep close tabs on the impact of rising prices on companies," a ministry official said.

Higher energy and raw material costs, driven by supply concerns amid Russia's war in Ukraine and the yen's drop against its major counterparts, have accelerated both wholesale and consumer inflation in Japan. A weaker yen inflates import costs for resource-poor Japan.

The U.S. Federal Reserve and other major central banks have been raising interest rates to cope with rising prices, even at the expense of slowing economic growth.

Overall sales at Japanese companies increased 6.1 percent to 372.59 trillion yen.

The ministry surveyed 32,331 companies capitalized at 10 million yen or more, of which 22,579, or 69.8 percent, responded.