Japan surpassed China to become the largest foreign holder of US Treasuries in June, with its holdings at the highest level in nearly three years, US Treasury Department said Thursday.

Japan’s holdings of US Treasuries increased 21.9 billion US dollars in June to reach 1.1229 trillion dollars, according to data from the department. It has been more than two years since Japan held more US Treasuries than China.

China, meanwhile, held 1.1125 trillion dollars of US Treasuries in June, a slight increase of 2.3 billion dollars from the previous month, after dropping for three months in a row.

Combined, China and Japan still held more than one third of the total foreign holdings of US Treasuries in the month.

Overall, foreign holders of US Treasuries had 6.6363 trillion dollars of government debt in June, up 97.2 billion dollars from May, indicating growing demand for the safe-haven asset.