* Shanghai shares, blue-chips fall most since Dec. 23
* Yuan steady, among best performing Asian currencies
* Iran strikes U.S.-led base in Iraq as revenge for top general
By Noah Sin and Winni Zhou
HONG KONG/SHANGHAI, Jan 8 (Reuters) - China shares fell the most in two weeks on Wednesday, reversing some of the sharp gains recorded in the past fortnight, after Iran’s firing of missiles at U.S.-led forces in Iraq stoked fears of a wider conflict in the Middle East.
Global markets reeled as Tehran took revenge at U.S.-led forces for killing one of its top military commanders. The Middle East tensions weighed on Asian stock markets, pushed oil prices higher and spurred rallies in safe-haven assets such as the Japanese yen and gold.
China’s yuan too remained stable, partly on account of its tightly managed exchange rate framework, providing an anchor for many of the Asian currencies.
Conflict-related tensions lifted shares of Chinese goldminers and defence companies, with the CSI national defense industry index rising to a near four-month high as discussions of a war intensified.
The Shanghai Composite Index and blue-chip stocks both shed more than 1%, marking their largest daily losses since Dec. 23, 2019. Earlier in the session, the Shanghai benchmark touched its lowest in more than a week.
Hong Kong stocks closed 0.8% weaker, having touched its lowest level since Dec.24 mid-trade.
The slide erased a small part of the massive gains China stocks have made since December on expectations of a Sino-U.S. trade deal being signed soon.
Yang Tingwu, vice general manager of hedge fund house Tongheng Investment, said his worst nightmare was that of a spreading Middle East crisis push oil prices higher, threatening to push China into stagflation.
China’s consumer price inflation is at a nearly eight-year high owing to a spike in pork prices.
“I don’t think the trade war is a big issue now,” said Yang. “But a possible surge in energy prices will result in stagflation in China, limiting central bank’s policy choice.”
If that happens, “Chinese stocks will descend into a gloomy, downward trend,” he added.
China’s onshore yuan remained flat for much of the session, trading at 6.9430 per dollar, as of 0705 GMT. The offshore yuan was also little changed near 6.9416.
“The ‘policy’ element in CNY movement may have led to some stability in the currency,” Frances Cheung, Singapore-based head of macro strategy for Asia at Westpac, referring to how the currency is managed by tools such as the central bank’s midpoint guidance rate.
“We may argue that the renminbi depicts some safe-haven characteristic but that is not too obvious,” she said.
Prior to the open, the People’s Bank of China set that midpoint - from which the onshore yuan can trade 2% either side - to the strongest in five months at 6.9450 per dollar.
“Expect the Asian currencies to look to the renminbi as an anchor of stability,” OCBC Bank’s analysts, who also attributed yuan strength to the stronger fix, wrote in a note on Wednesday.
The steady session came after the yuan made its strongest domestic close since August on Tuesday on the back of strong corporate dollar selling and some recovery of risk appetite.
That appeared to have set the tone for the U.S.-China phase-one trade deal scheduled for next week, said two traders in Shanghai, who feared state banks might intervene to keep the rally intact should the yuan ease too much on Wednesday.
Reporting by Noah Sin in Hong Kong and Winni Zhou in Shanghai; Additional reporting by Samuel Shen in Shanghai, Editing by Sherry Jacob-Phillips