By Saumya Vaishampayan in Hong Kong, Lingling Wei in Beijing and Carolyn Cui in New York

A crackdown by the People's Bank of China on wagers against the yuan propelled the currency to its largest-ever two-day gain against the dollar, highlighting the rising tension in foreign-exchange markets over the outlook for China.

The Chinese central bank tightened liquidity in Hong Kong on Thursday and Friday by instructing the nation's banks to withhold funds from other banks, a move that drove the yuan in offshore trading to its highest level since early November. The rate that banks charge each other in Hong Kong's overnight lending market leapt from 17% on Wednesday to 61% on Friday, thehighest in a year.

Analysts and investors attributed the swings to factors including the central bank's desire to punish short sellers by pushing up the cost of betting that the yuan will fall, a position that has become increasingly popular in markets as China's growth slows and its debt burden rises.

"The PBOC is again sending a strong signal to markets that the yuan's value remains under its control and that it will forcefully resist any one-way bets developing against the currency," said Eswar Prasad, a professor at Cornell University and a former head of the International Monetary Fund's China division.

The yuan soared 1.2% on Thursday to 6.7883 against the dollar in offshore trading. The currency strengthened 2.5% Wednesday and Thursday in Hong Kong. The gains were short-lived, though. The yuan fell 0.5% early Friday in the offshore market, even after China in its daily fixing set the yuan 0.9% stronger against the dollar-- its biggest increase since July 2005.

The central bank's actions rippled through global markets on Thursday. The yuan's gains, following a long period of retreat, shook the status quo that has mostly held since the November U.S. election of Donald Trump, prompting investors to sell many investments that have been popular and buy ones recently out of favor. The Dow industrials dropped 42.87 points to 19899.29 and the yield on the 10-year U.S. Treasury note fell 0.08 percentage point to 2.37%, while the dollar declined against the euro and yen.

The value of the Chinese currency and the pace of capital outflows from China rank among the most closely scrutinized trends in financial markets. Many investors view a disorderly slowdown in China's economy as one ofA the chief risks to global economic-growth expectations for 2017.

Borrowing costs for offshore yuan have been rising in recent months as the pool of the Chinese currencyin Hong Kong continues to shrink. Beijing has stepped up efforts to stem capital outflows by imposing stricter rules on foreign-exchange transactions. An expected increase in the value of the dollar, with the Federal Reserve raising interest rates, stands to place more downward pressure on the yuan.

Fears that China would sharply devalue the yuan helped fuel six weeks of global market mayhem at the start of 2016. In that episode, as well as in September 2015, the Chinese central bank intervened in both onshore and offshore markets by buying up the yuan through state-run banks, traders said at the time.

"The risk to China in 2017 is the same risk it faced in 2016, which is a strong dollar," said David Loevinger, a managing director at TCW Group and a former Treasury coordinator for China affairs.

Many analysts view China's economy now as healthier than it was then, thanks to a global economic upturn, but fears of a confrontationwith the Trump administration over trade and currency policy have added a new source of anxiety.

Over the past year, China's central bank has periodically sought to boost the yuan in the Hong Kong market by instructing Chinese banks in the city to withhold funds from other banks. The resulting liquidity shortages raise the cost of wagering against the currency. Economists and officials say yuan liquidity in Hong Kong became tighter again in the past couple of days as a result of the central bank's efforts to discourage bearish bets on the Chinese currency.

"The tightened policies are aimed at defeating those hoping to pile on bets against the renminbi," said a government adviser, referring to the central bank's most recent moves.

Declines in the yuan, also known as the renminbi, have taken the currency near 7 to the dollar, a psychologically significant level that traders view with trepidation.

To bet on a drop in the yuan, investors often "short" the currency by borrowing yuan in Hong Kong, swapping them for dollars and later swapping them back at a more favorable rate. As the cost of borrowing yuan rises, so does the cost of that trade. That can force investors to buy back yuan in Hong Kong, driving the currency higher.

"It's quite expensive to go short the renminbi," said Colin Harte, a multiasset portfolio manager at BNP Paribas Investment Partners in London.

In one sign of the intense liquidity squeeze spurred in part by PBOC action, banks in Hong Kong were forced to turn to the Hong Kong Monetary Authority, the city's de facto central bank, to borrow yuan in order to cover positions or meet obligations. By midmorning Thursday, they had drained the HKMA's 10 billion yuan pool of intraday funding and tapped two other yuan-funding pools. The banks' actions were "reasonable given the tight market liquidity," a monetary authority spokesman said, adding that authorities would continue to closely monitor the offshore yuan market.

Analysts say Beijing still faces a struggle to arrest the yuan's weakening. Businesses and individuals concerned about domestic asset bubbles and the uncertain outlook for China's economy are looking for returns outside the country.

The recent yuan rally "doesn't change my long-run outlook for a weaker Chinese currency," said Jens Nystedt, an emerging-markets portfolio manager at Morgan Stanley Investment Management in New York.

Chinese authorities have increased their efforts to stem the outflow of yuan in recent weeks with measures that include controls on outbound investments by Chinese companies and tighter rules on Chinese residents' converting yuan into foreign currencies.

This week, China's central bank also has been setting the yuan's official daily "fix" against the dollar at stronger-than-expected levels.

The result has beenfewer yuan in Hong Kong and a higher overnight yuan borrowing rate: Above 10% since Dec. 30, it soared to 61.3% Friday from 38.3% Thursday, the highest since a record 66.8% last Jan. 12.

Within mainland China, where the People's Bank of China limits yuan movement to 2% above or below a level it sets daily, the yuan rose 1% to close at 6.8817 to the dollar, its strongest since Dec. 8.

"I have no doubt that this is going to be a continued battle between market forces on the one hand and the PBOC on the other," Mr. Prasad said.

Gregor Stuart Hunter contributed to this article

Write to Saumya Vaishampayan at saumya.vaishampayan@wsj.com, Lingling Wei at lingling.wei@wsj.com and Carolyn Cui at carolyn.cui@wsj.com

(END) Dow Jones Newswires

January 05, 2017 22:53 ET (03:53 GMT)

Copyright (c) 2017 Dow Jones & Company, Inc.