Updated

Japan's economy grew at a 5.9 percent annualized rate in the first quarter, the fastest in nearly three years, as companies and consumers brought forward spending to beat a sales tax increase that is expected to cause a contraction in the current quarter.

The growth figures for the world's third-largest economy released Thursday were in line with expectations. Strong private consumption, residential investment and corporate spending were the biggest contributors to growth, while public spending fell slightly.

Since taking office in late 2012, Prime Minister Shinzo Abe has sought to get Japan's growth back on track through a combination of heavy government spending, ultra-loose monetary policy and economic reforms.

Although the economy was already recovering when Abe took office, his "Abenomics" formula is credited with boosting corporate profits and helping Japan escape from a longtime deflationary rut. Sustaining growth will require major reforms to boost competitiveness and unlock bottlenecks inhibiting growth, economists say.

"The evidence shows Abenomics has given a big boost to the economy so far, but it's mainly stimulus driven. The challenge is to shift to private sector demand," said Romain Duval, Asia-Pacific division chief at the International Monetary Fund.

Price increases are slowly moving toward a 2 percent official inflation target, thanks to the flood of money in the economy and to higher costs for imports due to a weakening in the Japanese yen.

Quarter-to-quarter growth, adjusted for inflation, was 1.5 percent, the fastest rate since the rebound from the March 2011 earthquake and tsunami. It was the sixth straight quarter of expansion.

Japan raised its sales tax to 8 percent from 5 percent on April 1, and economists expect that change to cause a contraction in the current quarter. But the latest data suggest growth may be buoyant enough to rebound relatively quickly.

The recovery in the U.S. and Europe may help Japan increase exports, so far an area that has lagged expectations as soaring import costs for energy, food and industrial components have outpaced increases in demand for Japanese products overseas.

But corporate spending has also been slow to pick up, as companies with fattened balance sheets have opted to expand operations and acquisitions offshore rather than beefing up their factories in Japan, where growth is expected to remain slow due to the aging and shrinking of the population.

Wages, likewise, have not kept pace with inflation, though the spring labor negotiations brought minor increases for the fraction of workers who are represented by unions.

Abe is due to present in June his latest explanation of his reform plans, which so far have made little headway.