WASHINGTON — Foreign holdings of U.S. Treasury securities fell in July as China, the biggest foreign owner of Treasury debt, trimmed its holdings.

The Treasury Department said Friday total foreign holdings dropped 0.6 percent in July to $6.25 trillion following a 1.1 percent increase in June.

China reduced its holdings 1.8 percent to $1.22 trillion, the second straight monthly reduction. Japan, the second-biggest foreign owner of Treasury securities, increased its holdings 0.7 percent to $1.15 trillion.

The Congressional Budget Office is forecasting that the national debt, which currently stands at $19.5 trillion, will increase by $8.6 trillion over the next decade, reflecting rising costs for Social Security and Medicare benefits as baby boomers retire. That rising debt underscores the need for the United States to maintain high foreign demand for Treasury debt.

Ireland ranked third in foreign ownership of Treasury debt with $269.6 billion in holdings in July, a decline of 0.3 percent from June. The Cayman Islands, an offshore banking center, was in fourth place with $264.3 billion in holdings, a decrease of 1.9 percent from June.

Of the $6.25 trillion in Treasury debt held by foreigners, $4 trillion — about two-thirds — is held by foreign governments, mainly foreign central banks who prefer the safety of U.S. Treasury securities for their investments.