China’s holdings of U.S. Treasuries fell for a third consecutive month in August as the Asian nation struggles to prevent the yuan from weakening amid trade tensions with America.

China’s ownership of U.S. bonds, bills and notes was $1.165 trillion, down from $1.171 trillion in July, according to data released by the Treasury Department on Tuesday. Japan, which is the largest foreign owner of Treasuries after China, decreased its holdings to $1.03 trillion from $1.036 trillion a month earlier. Saudi Arabia boosted its ownership by $2.7 billion to a record $169.5 billion.

Beijing’s sale of Treasuries is sometimes viewed as a response to the trade war, especially after China’s ambassador to the U.S. signaled in March his country could scale back purchases of the debt to retaliate against American tariffs. President Donald Trump since July has imposed tariffs on about half of Chinese imports, with Beijing responding with duties of its own on American goods.

“Holdings have declined over the past three months and may continue to do so as the ongoing trade war sours the relationship between China and the U.S. and thus reduces their appetite for Treasuries,” Thomas Simons, an economist at Jefferies LLC, wrote in a note after the department’s release. “This will be important to keep an eye on going forward.”

But China may have allowed its foreign-exchange reserves to decline as part of a policy to stabilize the yuan and prevent it from weakening further. The currency already has depreciated more than 4 percent against the dollar in the past year amid signs of an economic slowdown and capital outflows. Trump has accused Beijing of deliberately weakening its currency to stimulate exports.

Overall foreign holdings of U.S. Treasuries rose $35.4 billion to $6.287 trillion in August, with Brazil and Ireland also increasing their ownership.