SHANGHAI: China's market regulator on Friday made a long-term commitment to stabilizing the volatile stock market for a "number of years", in what analysts said was an attempt to boost weak investor sentiment.

The China Securities Regulatory Commission (CSRC) said the state-backed China Securities Finance Corp. (CSF), which is tasked with buying shares on behalf of the government, will have an enduring role.

"For a number of years to come, the China Securities Finance Corp. will not exit (the market). Its function to stabilize the market will not change," the CSRC said in a statement on its official microblog.

The CSF has played a crucial role in Beijing's stock market rescue, which was launched after Shanghai's benchmark crashed 30 percent in three weeks from mid-June.

Authorities gave the CSF huge funding to buy shares and subsequent speculation the government was preparing to withdraw from the stock market has spooked investors.

The regulator's comments were the first time it has given any indication of how long it would intervene to support equities.

Analysts said the CSRC was looking to shore up sentiment, even at a time when the market is stabilising.

"Although the strength of market-saving measures by government bodies is gradually decreasing, in order to keep investors' confidence in the market and prevent dramatic volatility, the CSF is showing that it will step in when it's necessary," Phillip Securities analyst Chen Xingyu told AFP.

The CSRC statement added the CSF would only enter the market during times of volatility.

"When the market drastically fluctuates and may trigger systemic risk, it will continue to play a role to stabilize the market in many ways," said the statement, which quoted CSRC spokesman Deng Ge.

CSF has transferred some of its stock to state-owned investment company Central Huijin Investment Ltd. to be held long-term, it said, but gave no further details.

Other government moves to prop up shares have included barring "big" investors from selling their stakes and cracking down on short-selling — a bet prices will go lower.

Shanghai stocks closed up 0.27 percent on Friday, capping their biggest weekly gain in two months as investors bet a surprise devaluation of the Chinese currency this week augured more measures from Beijing to boost sagging economic growth.

But the Shanghai index is still down more than 20 percent from its June peak.

Meanwhile, the yuan halted a three-day slide after China's central bank raised its reference rate for the first time since Tuesday's devaluation and said it will intervene to prevent excessive swings.

The onshore spot rate rose 0.11 percent, strengthening in the final minutes of trading for the third straight day and paring its drop for the week to 2.8 percent. The People's Bank of China said Thursday there's no basis for depreciation to persist and that it will step in to curb large fluctuations. It raised its daily fixing by 0.05 percent on Friday, after three cuts of more than 1 percent each.

Yuan bears make a case for more declines by pointing to the currency's real effective exchange rate, a measure adjusted for inflation and trade with other nations. It climbed about 14 percent over the last four quarters and was the highest among 32 major currencies tracked by Bank for International Settlements indexes.

In Shanghai, the onshore yuan rose the most since June 30 to finish the week at 6.3918 per dollar, 0.1 percent stronger than the fixing of 6.3975, according to China Foreign Exchange Trade System prices. It advanced 0.2 percent in the last 20 minutes of trading. At least two major Chinese banks sold the dollar near the close to prop up the yuan, according to two traders in Asia. One of them said local lenders have offloaded the greenback near the end of trading every day since Aug. 11.