U.S. Federal Reserve Chairman Ben Bernanke and other central bankers said on Friday the worst global recession in 70 years was nearing a close but warned it would be a long, slow climb back to normal growth.

At an annual Fed retreat set against the backdrop of the Grand Teton mountains, the officials said the coming recovery would have its ups and downs, and it was too soon to withdraw trillions of dollars in government and central bank support.

After contracting sharply over the past year, economic activity appears to be leveling out, both in the United States and abroad, and the prospects for a return to growth in the near term appear good, Bernanke said.

But both Bernanke and European Central Bank President Jean-Claude Trichet said there was still much work to be done to restore the global economy to self-sustaining growth.

Trichet said he was a bit uneasy about talk of a return to normal and that policy-makers should be as active as possible.

Surprisingly strong U.S. home sales figures, released just as Bernanke was beginning his speech, added to investor optimism that recovery was in sight, sending stock markets higher while U.S. government debt prices fell.

The conference, held at a no-frills rustic lodge in a national park in the western state of Wyoming, is a big draw for the world's leading monetary policy-makers and economists. The event includes a mix of speeches and academic papers.

This year's event sounded more upbeat than a year ago, when Bernanke and his counterparts were still struggling to get ahead of rapidly deteriorating financial markets.

Weeks after the 2008 gathering, Lehman Brothers bank collapsed and the United States rescued American International Group Inc, touching off a tumultuous period of slumping economic growth in both rich and developing countries.

AVERTING DISASTER

A large part of Bernanke's speech was devoted to reliving those months, looking at how officials around the world responded and what lessons they had learned about how to regulate and monitor financial markets.

We must urgently address structural weaknesses in the financial system, in particular in the regulatory framework, to ensure that the enormous costs of the past two years will not be borne again, he said.

Stephen Cecchetti, a senior official at the Bank for International Settlements, said strong, sustained growth would not be achieved unless the global financial system were fixed.

You don't want to become complacent ... just because things are staring to look better, he told Reuters Television. We've got to keep on the job.

Bernanke, whose term as Fed chairman expires in January unless President Barack Obama renominates him and he wins Senate backing, defended the U.S. central bank's controversial emergency rescue efforts and tried to explain why the Fed helped AIG but not Lehman.

The bailouts have landed the Fed -- and Bernanke -- in the middle of a sometimes heated political debate over whether it had overstepped its authority and ought to be reined in.

Bernanke credited an aggressive, coordinated policy response for averting the imminent collapse of the global financial system, an outcome that seemed all too possible.

Michael Feroli, an economist with JPMorgan in New York, said Bernanke's words did not change his view about the Fed's next policy steps.

The Fed is firmly on hold and isn't prepared to break out the confetti at the first signs of growth, he said. In fact, given the issues he focused on, Bernanke's talk seemed more directed toward the political establishment than toward nudging views of financial market participants.

In the past couple of weeks, reports have shown that some major economies, including Germany, France and Japan, generated positive growth in the second quarter, and polls showed that most economists think the current quarter will mark the end of the U.S. recession, which started in December 2007.

John Lipsky, the No. 2 official at the International Monetary Fund, said the outlook had not shifted sharply and noted that growth was being fueled by stimulative policies.

What remains to be seen is whether that expansion will be sustained, he told Reuters Television.

Germany's Axel Weber, a member of the ECB's Governing Council, also cautioned against getting too optimistic about prospects for Europe's biggest economy.

It is too early to draw the conclusion that everything is behind us, he told CNBC television.