TOKYO - Japan's economy grew in the second quarter at the fastest pace in more than two years as consumer spending and capital expenditure both rose at the fastest in more than three years, highlighting stronger domestic demand.

Gross domestic product expanded an annualized 4.0 per cent in April-June, government data showed, more than the median estimate for 2.5 per cent annualized growth and the biggest increase since January-March 2015.

Compared to the previous quarter, the economy expanded 1.0 per cent, versus the median estimate for 0.6 per cent growth.

Annualized GDP for previous quarter was revised to a 1.5 per cent increase, while quarterly real (inflation adjusted) GDP was revised up to 0.4 per cent growth from a 0.3 per cent increase.

Economic growth is expected to continue in coming quarters, offering the Bank of Japan (BOJ) the hope that a tight labor market is finally starting to boost consumer spending, which in turn makes it easier to generate sustained inflation.

'The engines of consumer spending and capital expenditure both fired well in the second quarter, and that's why domestic demand was so strong,' said Hidenobu Tokuda, senior economist at Mizuho Research Institute.

'The pace of growth may moderate slightly, but we are still in recovery mode. This is a positive development for inflation.'

The economy grew for six straight quarters in April-June. The last time the economy had a run of six consecutive quarters of growth was January-March 2005 through April-June 2006.

Private consumption, which accounts for about two-thirds of GDP, rose 0.9 per cent from the previous quarter, more than the median estimate of 0.5 per cent growth.

That marked the fastest expansion in more than three years as shoppers splashed out on durable goods such as cars and home appliances. Consumers also spent more money on dining out, the data showed. These are all encouraging signs that consumer spending is no longer the weak spot in Japan's economic outlook.

Capital expenditure jumped by 2.4 per cent in April-June from the previous quarter, doubling the median estimate for a 1.2 per cent increase. That was the fastest growth in business investment since January-March 2014 as companies spent more on software and construction equipment.

Japanese Economy Minister Toshimitsu Motegi was more cautious on the outlook for domestic demand and pledged to implement more policies to strengthen the economy.

'If you ask me whether private consumption has fully recovered, I would say it still lacks strength in some areas, which will need to be followed with policy,' Motegi told reporters.

'We'll make sure that the domestic demand-led recovery continues. What is needed is supply-side reform. We'll focus our efforts on human resource investment, improvement in productivity, and new growth strategies.'

While growth was faster than expected, it is not expected to nudge the Bank of Japan into dismantling its massive stimulus program any time soon, as inflation remains stubbornly weak.

External demand subtracted 0.3 percentage point from GDP growth in April-June in part due to an increase in imports. This is notable because Japan usually relies on exports to drive growth.

Since launching quantitative easing in April 2013, the BOJ has pushed back the timing for reaching its 2 per cent inflation target six times in part due to weak consumer spending.

The GDP data for April-June show private consumption is finally starting to move in the direction that the BOJ and other government ministers have long predicted.