Japan's economy grew 0.9 percent in the three months to June, marking the first expansion in five quarters on the back of exports and government stimulus spending, but analysts say it will be a long road to a sustained recovery.

The growth in the world's No.2 economy provided further evidence that the worst of the damage wrought by a global financial crisis may be over, but analysts and policy-makers are wary about the outlook, which depends on a recovery in world demand.

The preliminary figure, which fell slightly short of a median market forecast of a 1.0 percent increase, puts Japan in the first camp of G7 countries that have pulled out of recession, along with Germany and France.

It follows a revised 3.1 percent contraction in January-March and a 3.5 percent decrease in the final quarter of last year, which was the biggest drop on record.

On an annualized basis, Japan's economy grew 3.7 percent from the first quarter, the fastest since January-March 2008. That compared with a 1.0 percent contraction in the United States in the same quarter. The euro zone economy shrank 0.1 percent after a 2.5 percent fall in the first three months.

My interpretation is that it is a very good figure, said Junko Nishioka, chief economist at RBS Securities, referring to the annualized growth. She said it was slightly below the forecast, but that was partly due to technical reasons.

The positive contribution of public spending is likely to continue, so I don't think there will be a return to (contraction), as feared by some, Nishioka said.

Japan's economy is expected to continue to show moderate growth in the coming quarters.

But economists say the recovery could lose momentum later this year when a temporary boost from government stimulus steps, such as one-off payments and subsidies for energy-efficient cars and home appliances, peters out.

They expect Japan's economy to grow 0.4 percent in July-September from the previous quarter, followed by a 0.5 percent increase in October-December, a Reuters poll showed.

External demand, the balance of exports and imports, contributed 1.6 percentage points to GDP, due in part to China's $585 billion stimulus package and other such spending rolled out by governments around the world to combat the global recession.

Tokyo's stimulus steps helped private consumption, which accounts for about 60 percent of the economy, to rise 0.8 percent and public investment to increase 8.1 percent.

Capital spending fell 4.3 percent, smaller than a 5.9 percent drop expected by economists but marking the fifth straight quarter of slump, as companies remain cautious about the outlook for global final demand.

Japan's economy shrank more than most other major economies until January-March as its exports had plunged due largely to its specialization in machinery and high-end consumer products such as cars and flat-screen televisions.

The positive growth figures may give some political ammunition to Prime Minister Taro Aso's Liberal Democratic Party, which polls show faces defeat in a general election on August 30.

($1=95.14 Yen)

(Additional reporting by Leika Kihara and Rie Ishiguro; Editing by Michael Watson)