Japan remained the world's largest creditor at the end of 2020 for the 30th straight year, although the yen's appreciation against the U.S. dollar cut the value of its foreign assets, the government said Tuesday.

The country's net balance of external assets held by its government, companies and individual investors stood at 356.97 trillion yen ($3.3 trillion), down 0.01 percent from a year earlier and the first decline since 2017, the Finance Ministry said.

Japan's Finance Ministry in Tokyo. (Kyodo)

The yen strengthened against the dollar by nearly 6 yen from a year before, reducing the balance by around 22.9 trillion yen, an official told reporters by a ministry estimate.

Japan's total external assets grew 5.1 percent to a record 1,146.13 trillion yen as foreign direct and securities investments increased, with the value of foreign securities held by domestic investors rising.

Its overseas liabilities climbed 7.6 percent to a record 789.16 trillion yen, reflecting more investments in Japan by nonresidents and the higher value of Japanese securities held by foreign investors.

The impact of the coronavirus pandemic does not seem to have significantly weakened appetite for foreign investment, the official said, adding that instead it appears that ample funds provided by governments and central banks in their crisis responses led to more transactions to and from overseas.

In the reporting year, Germany ranked second with net external assets of 323.47 trillion yen, followed by Hong Kong with 223.09 trillion yen and China with 222.83 trillion yen, according to the ministry. The United States was the biggest net external holder of debts, which were worth 1,460.36 trillion yen.