Japan ran its biggest annual trade deficit of 19.97 trillion yen ($155.27 billion) in 2022, as higher energy and raw material prices along with the yen's precipitous fall boosted import costs, offsetting growth in exports as the impact of the COVID-19 pandemic waned, government data showed Thursday.

The value of imports jumped 39.2 percent to a record 118.16 trillion yen, led by crude oil, coal and liquefied natural gas, while exports grew 18.2 percent to 98.19 trillion yen, also a record high, due to increased shipments of cars and steel, the Finance Ministry said in a preliminary report.

The annual deficit of 12.82 trillion yen reported in 2014 was previously the country's largest. Comparable data became available in 1979.

The record red ink underscores the vulnerability of resource-scarce Japan, which has to rely on imports to meet domestic needs.

The depreciation of the yen, which plunged to its lowest level in over three decades against the U.S. dollar, exacerbated the pain, cutting into national wealth. The dollar averaged 130.77 yen in 2022, 19.5 percent higher than the year before.

A weak yen cuts both ways, inflating the value of imports but also boosting the overseas earnings of Japanese exporters. Alarmed by the yen's rapid fall against the dollar, a reflection of the divergent monetary policies of the Bank of Japan and the U.S. Federal Reserve, Japanese authorities intervened in the currency market to stem the depreciation.

Higher energy and raw material prices in 2022 were partly blamed on Russia's war in Ukraine, which raised supply concerns.

Japan joined Western nations in imposing economic sanctions on Russia. Exports to Russia dropped 29.8 percent last year as electronics and machinery shipments decreased, while imports grew 26.2 percent, boosted by liquefied natural gas and coal. Japanese firms are part of the Sakhalin-2 LNG project.

The current account balance, a wider gauge of international trade, was also affected by the massive trade deficit last year, though economists say Japan likely stayed in the black with a smaller surplus than a year earlier, helped by returns on foreign investments by Japanese firms.

Japan saw its trade surplus with the United States expand for the second straight year to 6.54 trillion yen, helped by strong exports of cars and machinery. U.S. bound shipments increased 23.1 percent to 18.26 trillion yen, while imports surged 31.5 percent to 11.72 trillion yen, led by medicines.

Trade with China was apparently hit by its strict "zero-COVID" policy, leading Japan's trade deficit to more than double to 5.83 trillion yen.

Imports grew 21.8 percent to 24.83 trillion yen, helped by clothing, smartphones and electronic components. Exports only increased 5.7 percent to 19.01 trillion yen.

Japan's trade surplus with the rest of Asia, including China, fell to 2.08 trillion yen, roughly a third of its 2021 level. The nation had a trade deficit of 2.02 trillion yen with the European Union, remaining in the red for the 11th year.

In December alone, the country's trade deficit stood at 1.45 trillion yen, with imports increasing 20.6 percent to 10.24 trillion yen and exports up 11.5 percent at 8.79 trillion yen. China-bound shipments fell for the first time in seven months.

The prospect of slowing growth in the United States and China -- Japan's two biggest trading partners -- is a concern this year, economists say.

Junichi Makino, chief economist at SMBC Nikko Securities Inc., expects the trade balance to improve significantly in 2023 as commodity prices will likely return to pre-pandemic levels while the U.S. Federal Reserve proceeds with monetary tightening.

"We are unlikely to see the outflow of national wealth caused by higher commodity prices, meaning that Japan can save around 22 trillion yen annually," Makino said.

"The global economy will see slower growth, not negative growth, so Japan's exports will likely be flat or rise slightly (from 2022)," Makino added.