The world’s second-largest economy increased its U.S. debt securities to $1.17 trillion as China’s trade surplus surged to the highest level in more than two years. China added Treasuries even as President Barack Obama and Republicans in Congress clashed over the U.S. debt ceiling.

“They continue to buy notes and bonds every month because they’ve got so much money,” said David Ader, head of government bond strategy in Stamford, Connecticut, at CRT Capital Group LLC. “If they stopped buying, they wouldn’t have much else to do with the cash, so they buy.”

Exports for China rose 20.4 percent in July from a year earlier and imports climbed 22.9 percent, leaving a trade surplus of $31.5 billion, the highest since January 2009.

Chinese investors’ U.S. notes and bonds rose to a record $1.16 trillion, according to the Treasury Department statistics released yesterday. China’s U.S. bills more than doubled to $10.1 billion from $4.5 billion in the previous month.

Total overseas holdings fell to $4.48 trillion after reaching a record $4.51 trillion in May. Foreigners cut holdings of Treasuries in June for the first time since April 2009.

“Foreign purchases were still a little less than expected in July, which is a shame for foreigners because the value of Treasuries rose tremendously,” said Guy LeBas, chief fixed-income strategist at Janney Montgomery Scott LLC in Philadelphia.

Bond Returns
Treasuries returned 1.8 percent in July and gained 2.8 percent last month, according to a Bank of America Merrill Lynch index. Bonds gained partly on demand for a refuge from the impasse over the federal debt limit. Obama signed a bill raising the ceiling Aug. 2.

U.S. debt securities have returned 7.8 percent this year, the most since the depths of the financial crisis in 2008, while the Standard & Poor’s 500 Index has fallen 3.6 percent.

Net buying of long-term equities, notes and bonds totaled $9.5 billion in July, compared with net buying of $3.4 billion in June, according to Treasury Department statistics. Including short-term securities such as stock swaps, foreigners sold a net $51.8 billion, compared with net selling of $29.4 billion in the previous month.