BEIJING, April 21 (Reuters) - Foreign investors increased their holdings of China's onshore yuan bonds in March, the foreign exchange regulator said on Friday, expecting more capital inflows amid signs of economic recovery.

A retreat in the U.S. dollar, a shrinking yield gap between the world's two largest economies and signs that China's economy is improving all contributed to foreign capital inflows, the regulator said.

"China's economy will continue to rebound and the opening up of the financial markets will be steadily promoted, and there is still room for foreign capital inflows," said Wang Chunying, spokesperson of the State Administration of Foreign Exchange (SAFE).

Wang said that proportions of foreign investment in both bonds and stocks remained relatively low.

Global institutional investors increased their holdings of Chinese onshore bonds traded in the interbank market in March by 10 billion yuan ($1.45 billion) to 3.21 trillion yuan, official data from the central bank's Shanghai head office showed on Friday, snapping two straight months of outflows.

China's economy grew at a faster-than-expected pace in the first quarter, as the end of strict COVID curbs lifted businesses and consumers out of crippling pandemic disruptions, although headwinds from a global slowdown point to a bumpy ride ahead.

Separately, the FX regulator also pledged to fend off risks from external market shocks while "making every effort" to maintain prudent operations of the foreign exchange market and financial safety.

"We've seen there are still unstable and uncertain factors in the external environment," Wang said, adding the regulator will continue to monitor and analyse impact from various factors, and improve its macro-prudential management and tool box.

It also said that the regulator will deepen FX reforms and push forward with opening up its capital account. ($1 = 6.8944 Chinese yuan)

(Reporting by Beijing Newsroom and Tina Qiao; Editing by Muralikumar Anantharaman and Kim Coghill)