Photo/Illutration Cars for export park at a port in Yokohama, near Tokyo on July 6, 2020. (AP Photo)

Japan’s trade deficit for the first half of this year totaled nearly 8 trillion yen ($58 billion), because of surging oil prices and a sinking yen, brought on partly by the war in Ukraine, and weaker global demand.

The deficit for the period from January through June marked the second consecutive half-year of deficits. The deficit for the six months ended in June totaled 7.92 trillion yen ($57 billion), according to Finance Ministry data released Thursday.

The deficit persisted even as imports for the six months shrank nearly 38 percent to 53.86 trillion yen ($390 billion), while exports grew 15 percent to 45.94 trillion yen ($332 billion).

In June, imports surged 46 percent while exports grew 19 percent, compared to the same month a year earlier, resulting in a trade deficit of 1.38 trillion yen ($10 billion), the biggest for the month since 2014.

By country, imports from China jumped 33 percent for the month on-year, while exports edged up 8 percent. Imports from the U.S. grew 25 percent, while exports rose 15 percent. Imports from the Middle East, source of a large share of Japan’s energy supplies, jumped 125 percent.

Junichi Makino, chief economist at SMBC Nikko Securities, noted that exports expanded in June supported by global demand for Japanese cars and computer chips.

The yen has been trading at about 138 yen to the dollar, down from about 110 yen a year ago, because Japan is sticking to a super-easy monetary policy of near-zero interest rates even as other nations, including the U.S., raise rates to combat inflation.

Oil prices have surged since Russia’s invasion of Ukraine in February and are now trading at around $100 a barrel.