TOKYO - The dollar struggled near 2-1/2 month lows, while the yen also sagged on Friday on reduced safe haven demand amid a switch in investors' view that the Sino-U.S. trade conflict would not lead to an immediate global shock.

The dollar index against a basket of six major currencies stood little changed at 93.908 after touching 93.829 overnight, its lowest since July 9.

The index has fallen more than 1 percent this week, with investor flows being diverted from the greenback to other currencies including emerging market ones amid an ebb in U.S.-China trade war concerns.

"It appears that positions which were skewed towards risk aversion are being reversed across the board," said Makoto Noji, senior strategist at SMBC Nikko Securities in Tokyo.

"The trigger was Chinese Premier Li's comments on the yuan, which has led to hopes of a more moderate outcome to the U.S.-China trade row," he said.

Premier Li Keqiang pledged on Wednesday that Beijing will not engage in competitive currency devaluation, a day after his country and Washington plunged deeper into a trade war with more tit-for-tat tariffs. 

The dollar had attracted strong demand thanks to trade-related tensions in recent months, as investors bet the greenback would gain at the expense of riskier currencies. The better risk sentiment contrasted with a Reuters poll showing forecasters were unanimous in viewing the trade row between the world's two top economies as bad for growth. 

The euro was a beneficiary of the shift in currency flows. The single currency was 0.05 percent higher at $1.1783  after climbing 0.9 percent the previous day, when it had scaled a three-month peak of $1.1785.

"The 'risk on' mood in light of optimism towards U.S.-China trade issues has cleared the path for the euro's rise," said Masafumi Yamamoto, chief forex strategist at Mizuho Securities in Tokyo.

Amid a bounce in currencies such as the Turkish lira and South African rand, ravaged earlier in the month by trade friction and domestic factors, MSCI's emerging market currency index rose to a three-week peak on Thursday.

The Australian dollar, a proxy of China-related trades as well as gauge of risk sentiment, climbed to a three-week high of $0.7297.

The Aussie has jumped nearly 2 percent this week, having pulled back from a 2-1/2-year low of $0.7085 plumbed on Sept. 11 and headed for its biggest weekly advance in 14 months.

S&P Global Ratings revised its outlook on triple-A rated Australia to stable from negative on Friday, providing the Aussie with a further lift.  

The dollar was up 0.25 percent at 112.745 yen, its strongest in two months.

"Higher U.S. yields, particularly the two-year yield's rise, has added further momentum to the dollar's gains versus the yen ahead of next week's Fed meeting," Yamamoto at Mizuho Securities said.

The two-year Treasury yield has climbed to a decade high this week on the back of receding risk aversion and expectations for a hawkish Federal Reserve meeting next week.

The Australian dollar, pound and euro also advanced significantly against the yen this week.

China's yuan was a shade higher at 6.8420 per dollar in onshore trade. It has gained about 0.35 percent on the week.

Expectations of a rise in bank lending rates and tightness in cash supplies caused a sudden spike in the Hong Kong dollar, pulling it off the lower end of its narrow trading band, where it had been stuck for six months.

The Hong Kong dollar rose to 7.8244 to the dollar, hitting its highest levels since late February. Since March, it had stayed near 7.85, the lower end of the Hong Kong Monetary Authority's managed trading band.

The pound hovered near a two-month peak of $1.3295 scaled overnight, when robust UK retail sales data added to confidence towards the currency already bullish on growing optimism that Britain and the European Union are making progress towards a Brexit deal.  

(Reporting by Shinichi Saoshiro; Editing by Shri Navaratnam and Richard Borsuk) ((shinichi.saoshiro@thomsonreuters.com; Reuters Messaging: shinichi.saoshiro.reuters.com@reuters.net))