Germany and France achieved a shock return to economic growth in the second quarter of the year, ending their recessions earlier than many policymakers and economists expected, but failed to drag the euro zone with them.

German gross domestic product rose by 0.3 percent in the second quarter, bringing an end to the country's deepest recession since World War Two.

French GDP also grew by 0.3 percent in the second quarter. The consensus in a Reuters poll of economists had predicted a 0.3 percent quarterly contraction in both countries.

The data is very surprising. After four negative quarters France is finally coming out of the red, French Economy Minister Christine Lagarde told RTL radio.

But in the 16-nation euro zone, GDP slid by 0.1 percent on the quarter, following a 2.5 percent drop in the first quarter.

That, though, was well above the 0.5 percent fall forecast before the French and German figures were released.

Looking forward, we think that the (euro zone) economy will increasingly benefit from the pick up in the global economy and the fact that the most aggressive phase of destocking is now behind us, said Nick Kounis at Fortis Bank. The big picture will be one of ongoing gradual recovery through 2010.

Germany suffered a calamitous 3.5 percent contraction in the first quarter of this year to cap four quarters of decline while the French economy shrank by 1.3 percent.

European shares and the euro climbed while euro zone government bond futures dropped after the figures fueled optimism about the outlook for the single currency bloc.

Aside from the euro zone's big two economies, other member nations continue to contract -- Italy's economy dropped by 0.5 percent in the second quarter, Austria and Belgium shrank by 0.4 percent and the Netherlands contracted by 0.9.

Greece and Portugal, though, grew by 0.3 percent.

RECOVERY AT LAST?

Evidence is mounting that the worst of the damage wrought by a global financial crisis, which began with a U.S. housing market meltdown in 2007 and took a turn for the worse last year when U.S. bank Lehman Brothers collapsed, is now over.

The recession has ended. Not just in Germany. The post-Lehman global confidence shock has receded. Firms are investing again, said Joerg Kraemer at Commerzbank.

The Federal Reserve said on Wednesday the U.S. economy was showing signs of leveling out two years after the onset of the deepest financial crisis in decades.

It was the first time since August 2008 its statement had not characterized the economy as contracting or weakening.

The Bank of England struck a slightly more subdued tone in its quarterly inflation report on Wednesday, saying Britain's recession would end early next year.

Britain now looks in relatively poor shape, its economy having shrunk by 0.8 percent in the second quarter.

In France, the second quarter rise was supported by solid consumer spending, which has been propped up by government stimulus measures ranging from tax breaks to car trade-in schemes, and a surprise turnaround in exports.

Year-on-year, German GDP fell by 7.1 percent in the second quarter, following a 6.4 percent drop in Q1.

The government expects the economy to contract by some six percent this year but the Economy Ministry had already said the economy probably stabilized in the second quarter.

The figures should encourage us, German Economy Minister Karl-Theodor zu Guttenberg said in a statement. However, there are no grounds for euphoria, because we're still a long way from seeing the economy back at the level that it was at last year.

REASONS TO BE CAUTIOUS

Experts also remain cautious with budget deficits spiraling under the weight of government stimulus packages and unemployment levels set to climb for some time.

If firms decide to start firing people in the autumn rather than putting them on shorter hours, it's going to have a negative impact on wages and hit consumption (in Germany), said Christian Dreger of the DIW economic institute.

Banks in many countries also remain in poor shape, reliant on state support and reluctant to lend.

There are lots of problems we haven't solved, said Jens-Oliver Niklasch, analyst at LBBW. As long as it's not clear that the banks' capital base is robust, we can't assume that the crisis is over.

But if nothing else, the prospect of a 1930s-style depression appears to have been banished.

We had contracted so much over the past four quarters that a return to growth is almost mechanical, said Marc Touati at Global Equities in Paris. Still, it's good to see that we're not in a 1929 or 1930s type situation of total collapse.

(Writing by Mike Peacock; editing by Chris Pizzey)