France has followed in Germany's footsteps and has waded out of a shallow recession by beating analysts' expectations following a boost in consumer spending and industrial output.

According to preliminary data from the Insee statistics agency, France exited its recession by posting 0.5% economic growth for the second quarter this year, whereas analysts predicted that the eurozone's second largest economy would expand by only 0.2%.

While this was the strongest quarterly growth of President Francois Hollande's 15 months in office, and the biggest rise since early 2011, investment contracted for the sixth quarter in a row.

Insee's forecast for the €2tn French economy, for the whole of this year, is at only 0.1%.

Germany and France Leading the Pack

Data published today is set to confirm that Germany and France will lead the eurozone out of its longest recession.

"German and French growth figures ahead of the European market has enthused investors on Wednesday morning," said Ishaq Siddiqi, market strategist at ETX Capital.

"Both economies showing a solid upswing, particularly France given how markets have worried about the government's slow implementation of budget reforms."

Germany overshot analysts' expectations by posting its strongest rate of economic growth in more than a year following a rise in domestic private and public consumption.

Europe's largest economy expanded by 0.7%, whereas market consensus, pegged Germany to grow by 0.6% in the second quarter this year.

"Germany's figure certainly suggests that the worse of the economic turmoil in the country is over and the region's powerhouse is back on its feet," said Siddiqi.

"It is also music to the ears of Chancellor Angela Merkel who is fighting for her job at next month's national elections."

While Germany is tipped to drag the eurozone out of a recession, analysts still warn that growth will be modest.

"The eurozone has been hauled out of recession and Germany has done the lion's share of that," said Andreas Scheurle, analyst at Dekabank.

"It was made possible by our generous consumers who have again spent more money but the state has also dug deeper into its pockets ... Exports have also provided a boost.

"But this rhythm can't be maintained. Growth will become more modest and in second half of the year we should see plus 0.3 to 0.4%."