Japan's economy shrank a record 4.0 percent in the first quarter as domestic demand and investment buckled, threatening to crush an anticipated export-led rebound in the second half.

Any recovery depends on whether Japanese exporters, who have begun replenishing depleted inventory, see demand picking up in Western markets, and whether Tokyo's $160 billion stimulus plan can pull consumption at home back from the brink.

The Bank of Japan appeared pessimistic on both counts. Governor Masaaki Shirakawa said the rebound in output around the world was due solely to restocking and that consumption and investment would remain weak.

Even though exports plunged a record 26 percent in January-March and companies slashed inventory, there were signs at the end of the quarter that world trade may have begun to pull out of a dive triggered by the global financial crisis.

By contrast the outlook for Japan, where GDP is shrinking more than twice as fast as in the United States, has darkened dramatically. Capital spending sank at the fastest pace on record, while private consumption suffered its biggest decline since 1997.

The export plunge is spreading to domestic demand, said economist Hiroshi Shiraishi at BNP Paribas.

As such, the Japanese economy may return to growth temporarily but it could suffer a contraction again afterwards.

PRIVATE CONSUMPTION

The GDP contraction was less than the 4.2 percent median forecast in a Reuters poll, but analysts had failed to anticipate the depth of the domestic downturn.

Private consumption fell 1.1 percent, compared with 0.8 percent in the previous quarter. The forecast was for a decline of 0.9 percent.

Capital spending shrank 10.4 percent, the fourth straight quarter of decline, following a 6.7 percent drop in the previous three months. The forecast was for an 8.1 percent fall.

Analysts polled a week ago forecast growth this quarter of 0.1 percent.

But not before there is more bad news.

The preliminary GDP data does not capture changes in inventory or the Ministry of Finance's capital spending survey, said Hideki Matsumura, a senior economist at Japan Research Institute. That survey would likely point to a steeper decline in inventory and therefore a sharper contraction in revised GDP, Matsumura said in a research note.

Inventories' contribution to GDP fell 0.3 percent, according to the figures released on Wednesday.

Domestic demand was the biggest drag on the economy, with the contribution falling to 2.6 percent, the worst since 1974.

RECOVERING MILDLY

Some economists forecast tepid growth through the year, saying Prime Minster Taro Aso's stimulus plan, the largest in Japan's history, would boost consumption, which accounts for about 55 percent of GDP.

From July-September, stimulus packages will boost growth, so I expect the economy to continue recovering mildly for the rest of the year, said Hiroshi Watanabe, a senior economist at Daiwa Institute of Research. Exports and output would rise in April-June, he said.

Industrial output grew 1.6 percent in March, the first gain in six months. The inventories-to-shipments ratio fell in March after rising the previous month, suggesting that more new items were being sold.

Shirakawa said there was no cause yet for optimism.

Exports and output are bottoming out. But this is due to progress in inventory adjustments. What will happen after inventory returns to normal levels depends on final demand, he said in parliament.

Finance Minister Kaoru Yosano shared his caution.

It will take considerable time and hardships for Japan to return to a growth path as in the past and there are many preconditions for this, such as how economic performance improves in other countries, Yosano told reporters.

The worst is probably over, but more efforts will be needed for the economy to ride an updraft, Yosano said, adding that the most effective step was to implement the extra budget to carry out the $160 billion stimulus.

Japan's heavy reliance on export industries for growth has seen its economy suffer more those of its peers, which took a much bigger initial hit from the global financial meltdown that began in the U.S. mortgage market.

The U.S. economy sank 1.6 percent in the first quarter, or 6.1 percent annualized, while the euro zone economy contracted 2.5 percent.

The decline in Japanese GDP, the biggest in records going back half a century, follows a 3.8 percent contraction in the previous three months.

($1=95.57 Yen)

(Additional reporting by Hideyuki Sano, Stanley White and Chisa Fujioka; Writing by Dayan Candappa; Editing by Michael Watson)