NEW YORK, Sept 16 (Reuters) - Foreign holdings of U.S. Treasuries grew for a third straight month in July, data from the Treasury department showed on Wednesday, as investors snapped up U.S. debt in a world of negative-yielding bonds.

Overseas investors held $7.087 trillion in U.S. Treasuries in July, from $7.039 trillion the previous month.

"General foreign buying of Treasuries reflects the global low interest environment," said Gennadiy Goldberg, senior rates strategist, at TD Securities in New York. "Investors are still very much starved for yield."

On a transaction basis, however, U.S. Treasuries showed foreign outflows in July of $22.79 billion, from inflows of $28.89 billion in June. U.S. Treasury outflows persisted in four of the last five months.

At the height of the coronavirus pandemic, the market saw record Treasury debt outflows of $310.79 billion in March.

Benchmark U.S. 10-year Treasury yields ended July at 0.53% , down from 0.68% at the beginning of the month.

Japan remained the largest non-U.S. holder of Treasuries during the month, ahead of China, with Japanese holdings rising to $1.293 trillion in July, from $1.262 trillion in June.

"On a foreign exchange-hedged basis, it became attractive for Japanese investors to buy U.S. Treasuries," said TD's Goldberg.

For Japanese investors, buying U.S. 10-year debt and hedging back to yen using three-month currency forwards would net a total yield of 10 basis points, Neuberger Berman data showed. It was -74 basis points a year ago, and negative for nearly three years before that, due to higher U.S. interest rates.

China's holdings of Treasuries slipped to $1.073 trillion in July, from $1.074 trillion the previous month.

Foreign investors, meanwhile, purchased $15.99 billion of U.S. stocks in July, from $28.522 billion in June. In May, foreigners saw record buying of $79.7 billion. U.S. corporate bonds, however, saw a record outflow of $54.35 billion in July, from $16.6 billion in June. U.S. residents decreased their holdings of long-term foreign securities, with net sales of $37.5 billion in July, from net sales of $34.2 billion in June. (Reporting by Gertrude Chavez-Dreyfuss; Editing by Andrea Ricci and Lincoln Feast.)