(Adds investment flows by categories, comment)
By David Gaffen
July 16 (Reuters) - Foreigners bought more than $19 billion in U.S. long-term securities in May, including Treasuries and corporate bonds, after selling debt in April, the U.S. Treasury Department said on Wednesday.
Including short-term debt and banking inflows overseas investors purchased $35.5 billion of U.S. securities, of which $22.4 billion was acquired by foreign official institutions.
The largest purchasers of U.S. debt were Japan and China, who bought $10.4 billion and $7.7 billion in debt, respectively, in May. China is the largest foreign holder of U.S. debt at $1.27 trillion, with Japan ranking second with $1.22 trillion in holdings.
Belgium's holdings fell for a second consecutive month. That country's official holdings had risen dramatically in recent months due to purchases by clearinghouse Euroclear on behalf of other institutions. In May, total holdings were $362.4 billion, down from $366.4 billion in April.
The most significant sales came from the United Kingdom, with $5.7 billion in net sales.
Foreigners bought a net total of $10.78 billion in corporate equities in May, the biggest month for purchases of equities since September of last year.
For the second month in a row, foreigners were net sellers of corporate debt, with net sales of $5.39 billion, though official foreign institutions purchased $1.21 billion in corporate debt. Foreigners have been steady sellers of corporate debt recently, with net sales in six of the last seven months.
Foreigners purchased a net $4.17 billion in agency securities in May after six consecutive months of sales, which Ian Lyngen, senior government bond trader at CRT Capital in Stamford, Connecticut, suggested was the result of the coming end of the Federal Reserve's quantitative easing policies.
U.S. residents, meanwhile, boosted their holdings of foreign securities to $9.205 trillion, up from $9.102 trillion in March.
Reporting by David Gaffen; Editing by Chizu Nomiyama and W Simon