Japan's trade deficit in fiscal 2023 shrank around 70 percent from a year earlier to 5.89 trillion yen ($38 billion), as robust U.S.-bound auto shipments lifted overall exports to a record high, government data showed Wednesday.

The resource-poor nation has seen a drop in the value of energy imports in recent months, while the continued growth of exports to the United States has helped to offset slackening demand from China.

In March alone, exports swelled to 9.47 trillion yen, up 7.3 percent, according to the Finance Ministry. Imports, meanwhile, fell 4.9 percent to 9.10 trillion yen.

In the fiscal year ended March, exports rose 3.7 percent to 102.90 trillion yen, topping 100 trillion yen for the first time and marking a record high for the third straight year.

Car exports, which account for about 17 percent of Japan's total, grew 30.2 percent to 17.88 trillion yen, eclipsing the previous record of 14.67 trillion yen in fiscal 2007.

Imports dropped 10.3 percent to 108.79 trillion yen, falling for the first time in three years, as coal, liquefied natural gas and crude oil all declined by double digits in value terms.

With a weaker yen inflating Japan's import costs and accelerating inflation, the country remained in the red for the third straight year following a whopping 22.06 trillion yen deficit in fiscal 2022.

"We cannot be optimistic about the outlook because export growth isn't strong without cars," said Yuichi Kodama, chief economist at the Meiji Yasuda Research Institute.

"The U.S. economy has so far been resilient, but it will likely see a slowdown after aggressive rate hikes. China's economy may have already hit bottom but remains at a standstill. Adding to this is uncertainty over the Iran-Israel conflict," Kodama said.

Japan relies heavily on energy imports and higher crude oil prices amid heightened tensions in the oil-producing Middle East will boost costs.

Despite caution about the possibility of a market intervention by Japanese authorities to slow the yen's sharp depreciation, the currency is currently at levels unseen in over three decades.

The U.S. dollar was 6.5 percent higher against the yen in fiscal 2023 and 10.7 percent higher as of March.

Japan's trade surplus with the United States expanded for the third straight year to 9.14 trillion yen, rising 37.8 percent from a year earlier, due largely to record exports.

Exports expanded 11.6 percent to a record 20.86 trillion yen, compared with imports that fell 2.9 percent to 11.73 trillion yen.

Japan saw its trade deficit with China shrink for the first time in three years as imports fell more than exports.

Imports decreased 4.5 percent to 24.20 trillion yen while exports dropped 1.3 percent to 18.27 trillion yen.

Japan's trade surplus with the rest of Asia, including China, increased roughly 4.7-fold to 1.87 trillion yen.

The trade deficit with the European Union shrank by 60.3 percent to 721.96 billion yen, though Japan remained in the red for the 12th straight year.

Exports rose 10.7 percent to 10.61 trillion yen while imports were down 0.6 percent at 11.33 trillion yen.

Related coverage:

Yen sinks to 153 range vs. dollar, 1st time in 34 years

Japan big makers' sentiment worsens for 1st time in 4 quarters: BOJ