China's yuan hit a five-year peak on Monday after Beijing suddenly relaxed controls ahead of this weekend's G20 summit, sparking stock gains around the world and questions about just how far China's new currency flexibility would go.

China's central bank has maintained a de facto peg since the middle of 2008, a controversial policy aimed at steadying the world's fastest-growing major economy during the global economic downturn.

But the People's Bank of China (PBOC) stepped aside on Monday after its surprise weekend announcement that it would allow more flexibility for the yuan, buying some time against critics who argue the currency is undervalued and gives China an unfair advantage in trade.

U.S. stocks climbed on Monday, mirroring gains on overseas markets, as investors bet that China's currency move would invigorate global economic recovery and raise long-term prospects for U.S. multinationals.

The central bank ruled out a one-off revaluation of yuan and suggested it was at close to fair value.

China's major trading partners welcomed the decision, which the European Central Bank chief Jean-Claude Trichet said goes in the direction of more stability and more prosperity at the global level for all partners.

We're obviously encouraged, White House spokesman Bill Burton told reporters in Washington.

But analysts said Beijing still needs to do more to show the G20, whose leaders meet in Canada on June 26-27, that it is serious in its commitment to make the yuan more flexible and address global trade imbalances.

Some countries will want to see more detail and perhaps even a schedule of some sort, Canadian Finance Minister Jim Flaherty told reporters in New York on Monday.

U.S. Ambassador to China Jon Huntsman called China's move a genuine attempt at currency reform and predicted it could smooth sometimes testy Sino-U.S. relations. I think it takes an irritant off the table in the U.S.-China relationship, he said following a speech in Hong Kong.

Some of China's strongest critics in the U.S. Congress are unlikely to be impressed, however, and U.S. officials have signaled they will press for vigorous implementation of the new policy.

UNEXPECTED BOOST

Nevertheless, Beijing's move on the yuan -- although small by comparison with freely floating currencies -- provided an unexpected boost ahead of the G20 meeting.

China's central bank, after setting the mid-point for Monday's trading range, let the yuan rise 0.42 percent to 6.7976 per dollar, both the biggest daily gain and the highest close since China revalued the currency and introduced a managed float regime in 2005.

At one point, the yuan was up as much as 0.47 percent from the day's mid-point -- just shy of the currency's 0.5 percent limit, which had rarely been tested in practice in the past.

Traders said the lack of intervention by the central bank suggested it wanted the market to drive intraday trade and so underline its weekend pledge.

But it also showed it had ultimate control by setting the reference rate, around which the yuan can trade, at the same level as Friday's fixing.

Traders said it was unlikely the yuan would repeat gains on the same scale in coming days, with Tuesday's mid-point setting serving as an important barometer of how much more appreciation the central bank is willing to stomach.

It is still too early to say what the PBOC is going to do in the coming days but we expect the trend to be gradually lower rather than volatile, said Callum Henderson, global head of FX strategy at Standard Chartered Bank in Singapore.

Tomorrow's fixing is awfully key in terms of the sentiment of the market. One can pontificate on what is going to happen based on one day, but frankly it is a guessing game on what is going to happen. We will have to see the fixing tomorrow and that should set the tone for the next couple of days.

China's economic strength gave policymakers confidence to end the peg, but they remain worried demand for China's exports is not on a solid footing given risks like Europe's debt woes.

Chinese Commerce Ministry spokesman Yao Jian told the official Xinhua news agency that yuan reform could put pressure on exports initially, as firms were likely to face higher material costs, but would yield long-term benefits.

MARKETS OPTIMISTIC

Markets, for their part, were optimistic.

European shares rose to a seven-week closing high while U.S. shares also jumped on the yuan move, although technical factors later pared some gains.

This can be viewed as a vote of confidence by the Chinese officials in the strength and the resilience of the Chinese economy and that is being taken as positive, said Klaus Wiener, head of research at Generalis Investments.

Asian currencies and stocks rose and U.S. Treasuries fell on expectations that China's promise to give the currency new room to move would ease political tensions with the West and encourage investors to snap up riskier assets.

Commodities and oil also surged, as a stronger currency would give the world's third-biggest economy more purchasing power which would be positive for world trade, especially for commodity exporters such as Australia, Brazil, Canada and New Zealand.

Crude rose more than 1 percent, while copper and zinc traded in Shanghai both rose by their daily limits.

Many economists see the currency strengthening further in coming days, but at a very modest pace, meaning some of Monday's early exuberance could turn out to be overdone.

A Reuters poll of 33 economists showed they expected the yuan to end the year at 6.67 per dollar, a rise of 2.4 percent from late last week before China's policy announcement and similar to the appreciation implied by offshore non-deliverable forwards.

(Additional reporting by Koh Gui Qing, Edmund Klamann, Karen Yeung, Saikat Chatterjee, Simon Rabinovitch, Wayne Cole, Pedro da Costa, Ben Blanchard, Leah Schnurr and Sui-Lee Wee; writing by Andrew Quinn; editing by Simon Denyer)