Capital flowed into China last month for the first time since an unexpected currency devaluation in August shook investor confidence in the economy, easing fears over financial stability following an unprecedented bout of outflows.

Capital has exited China at a record pace this year as an economic slowdown pushed Chinese gross domestic product growth to its slowest pace in six years. Outflows accelerated following the central bank’s unexpected move in August to let the renminbi weaken and the main stock index fell more than 40 per cent beginning in late June.

The outflow trend reversed in October as the central bank and other Chinese financial institutions bought a net Rmb12.9bn ($2bn) in foreign exchange, breaking a four-month streak of net sales, according to data from the central bank released on Saturday. Net forex purchases are considered a sign of capital inflow, while sales indicate outflows. October’s purchases followed record-high net sales of Rmb761bn in September.

Separate data earlier this month showed that China’s official foreign exchange reserves — which only include holdings by the central bank — rose by $11.4bn in October, breaking a five straight months of decline. Total reserves stood at $3.53tn at the end of last month, down from a peak of $3.99tn in June 2014.

“The fear of [renminbi] devaluation has been alleviated a lot recently. When the renminbi surprisingly depreciated on August 11, we predicted that the renminbi would depreciate less than 5 per cent by year-end,” wrote Larry Hu, China economist at Macquarie Securities.

“That call has become much less controversial recently compared with three months ago.”

After its move in August to allow the renminbi room to weaken, the People’s Bank of China drew on its foreign exchange reserves to prevent the currency from weakening too sharply. After the PBoC spent as much as $200bn in August alone to support the currency, analysts worried that China’s forex reserves could be quickly exhausted if the central bank continued intervention at that pace.

The latest data suggest that market sentiment toward the renminbi — which turned sharply bearish after the August move — has improved.

Chart: China capital flows

Analysts say the PBoC’s market intervention persuaded investors that the government would not permit a large fall in the currency. The central bank also re-imposed some restrictions on transferring funds abroad to curb outflows.

Adding to improved sentiment, China’s stock market has returned to bull market territory from its lows of late August, and the bond market is also rising on the back of successive interest rate cuts by the PBoC.

The International Monetary Fund staff recommended on Friday that the renminbi be added to join the elite basket of currencies used to value the fund’s own de facto currency, known as Special Drawing Rights.

“The continued stabilisation of the Chinese economy and the renminbi’s likely inclusion in the IMF’s SDR basket will help support a stable exchange rate and limit capital outflows through the rest of 2015,” wrote Shen Jianguang, China economist at Mizuho Securities.