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 their fastest in more than three years highlighting stronger domestic demand, government data showed.

Gross domestic product expanded an annualized 4.0 percent in April-June, government data showed, more than the median estimate for 2.5 percent annualized growth and the biggest increase since the three-month period ended March 2015.

Compared with the previous quarter, the economy expanded 1.0 percent, versus the median estimate for 0.6 percent growth.