Image copyright Reuters Image caption Strong consumer spending helped to offset a drop in exports

Japan's economy grew at its fastest pace for more than two years in the second quarter as consumer spending and capital expenditure ramped up.

Gross domestic product expanded at an annualised rate of 4% in the April-to-June period, government data showed, beating expectations for a 2.5% rise.

The economy grew 1% compared to the previous quarter.

Japan is enjoying its longest economic expansion in a decade, buoyed by spending and investment.

The world's third-largest economy has been gaining strength thanks to rising exports, including smart phones and memory chips.

Investment tied to the Tokyo 2020 Olympics has also given Japan's economy a boost in recent months.

Consumer spending

Strong domestic demand helped to offset a drop in exports during the second quarter of the year.

Analysis: Andew Walker, BBC economics correspondent

Is this a triumph for Abenomics? Well up to a point. Certainly, the growth in consumer spending and business investment is welcome. Nonetheless while six consecutive quarters of growth may be Japan's best run in a decade, it is not that impressive compared with other developed economies.

Image copyright Getty Images Image caption Japan's Prime Minister Shinzo Abe

Abenomics is at best unfinished business. At 0.4% inflation is still well below the Bank of Japan's 2% target. And there is the demographic challenge, Japan's rapidly ageing population and declining workforce.

There are reform plans in the Abenomics agenda, intended to encourage more people to get in to the labour market. Japan needs that to work.

Japan has been trying to lift consumer spending, which accounts for more than a half of the country's GDP.

The latest figures could be a help to Prime Minister Shinzo Abe who pledged to reignite growth and spending through his Abenomics reforms.

Mr Abe has seen his popularity sink recently over a series of scandals including claims he exploited his political power to help a friend.

Falling prices

Japan has battled years of deflation, or falling prices, and slow growth following an equity and property market bubble in the early 1990s.

The Abenomics programme, a mix of monetary easing, government spending and structural reforms, was designed to reignite the once-booming economy and lift consumer prices.

Falling prices can discourage spending by consumers, who might put off purchases in the hopes that prices will drop further.

That hurts businesses, as it can stop firms from increasing production, hiring new staff or increasing wages.

Shinke Yoshiki, chief economist at Dai-ichi Life Research Institute said the latest growth figures were a "good result and tailwind for Abenomics."