Japan posted a trade deficit of 1.44 trillion yen ($10.7 billion) in July against a backdrop of rising import prices driven by Russia's invasion of Ukraine and the yen's weakness, remaining in the red for the 12th straight month, government data showed Wednesday.

Imports jumped 47.2 percent from a year earlier to 10.19 trillion yen, increasing for the 18th straight month and bringing the deficit to all-time high for July. Exports rose 19.0 percent to 8.75 trillion yen, up for the 17th month in a row.

The values of imports and exports were both the highest since comparable data became available in January 1979, according to the Finance Ministry's preliminary report.

Analysts warn that the outflow of income under the prolonged trade deficit is hurting companies and households at home at a time when the broader economy shows few signs of sharp recovery from the novel coronavirus shock.

Imports soared as prices for crude oil from the United Arab Emirates and those for coal and liquefied natural gas from Australia were higher.

Exports gained due largely to brisk shipments of automobiles and semiconductor manufacturing devices to the United States and those of diesel fuel to the Philippines, the ministry said.

A ministry official attributed the expansion in imports and exports mainly to rising prices, while saying crude oil prices were around twice as high compared with the same month last year.

The value of petroleum imports rose to 1.14 trillion yen in the reporting month from a year earlier, increasing for the 16th consecutive month, the ministry said.

A financial board at a foreign exchange house in Tokyo's Shimbashi area on July 11, 2022, shows the dollar surging to the lower 137 yen range. (Kyodo) ==Kyodo

The average foreign exchange rate in July stood at 136.05 yen, with the yen sliding 23.1 percent against the dollar from the previous year, it added.

With imports from the United States surging 46.9 percent to 1.06 trillion yen, increasing for the 17th consecutive month, Japan's trade surplus with the world's biggest economy decreased 22.4 percent from a year earlier to 512.8 billion yen.

By item, imports of U.S. liquefied natural gas and coal significantly rose amid Japan's efforts to reduce its dependence on Russian energy in response to Moscow's aggression against Ukraine, which started in late February.

Imports from and exports to China, the world's second largest economy, also rose, up 34.6 percent and 12.8 percent from the previous year, respectively.

Personal computers and mobile phones contributed to the surge in imports from China to 2.21 trillion yen, while electronic components including chips as well as audio visual devices helped exports climb to 1.78 trillion yen.

Looking ahead, Kazuma Kishikawa, an economist at Daiwa Institute of Research, said overall exports may improve at a moderate pace but that the positive effects of the yen's depreciation are unlikely to emerge immediately.

A falling yen usually supports exports by making Japanese products cheaper abroad and boosts the value of overseas revenues in yen terms, while pushing up import prices.