Germany and France enjoyed a surprising return to economic growth in the second quarter of the year, data showed on Thursday, ending their recessions earlier than many policymakers and economists had expected.

German gross domestic product rose unexpectedly by 0.3 percent in the second quarter, bringing an end to the country's deepest recession since World War Two and boosting hopes of recovery in the broader euro zone.

French Economy Minister Christine Lagarde pre-empted data due at 2:45 a.m. EDT, announcing gross domestic product in her country also grew by 0.3 percent in the second quarter.

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

The consensus forecast in a Reuters poll of economists had predicted a 0.3 percent quarterly contraction in both Germany and France in Q2.

Germany suffered a calamitous 3.8 percent contraction in the first quarter of this year to cap four quarters of decline -- although Thursday's data revised that drop to 3.5 percent -- while the French economy shrank by 1.2 percent.

Euro zone GDP data are due at 5 a.m. EDT with the risks to forecasts of a 0.5 percent quarterly contraction now clearly to the upside.

Market response was instant.

The euro climbed and euro zone government bond futures opened down after the economy figures fueled optimism about the outlook for the single currency bloc's economy.

European shares were poised to open higher on the data and after the U.S. Federal Reserve said late on Wednesday the world's biggest economy was showing signs of stabilization.

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 is the first time since August 2008 that the committee's statement had not characterized the economy as contracting, weakening, or slowing.

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 but that the economy would take a long time to recover properly.

Italy, the euro zone's third largest economy, reported last week its economy shrank by 0.5 percent in the second quarter but that too was a better result than had been expected.

Year-on-year, Germany shrank by 7.1 percent in the second quarter, the data showed, following a 6.4 percent drop in the January-March period.

The government expects the economy to contract by some six percent this year. However, the Economy Ministry had said before the publication of the GDP figures that the economy probably stabilized in the second quarter.

Lagarde said solid exports and strong public sector investment, fueled by government stimulus measures to counter the global economic crisis, were bolstering growth in France.

A government trade in scheme for old cars and falling prices, particularly among big retailers, were helping consumers, she said. (Writing by Mike Peacock; editing by Chris Pizzey)