TOKYO — Japan's longest straight period of expansion in nearly three decades ended in the first quarter of this year as the economy shrank at an annualized rate of 0.6 percent.

Growth for the previous quarter was also revised downward according to data released Wednesday that reflected weaker spending by consumers, businesses and the government.

On a quarterly basis, Japan's gross domestic product dipped 0.2 percent, the Cabinet Office reported.

Analysts had expected a contraction, the first quarter pullback in two years. It ended the longest straight period of uninterrupted growth since the late 1980s.

"There wasn't any particular driver for the weakness — private consumption and public demand were flat while investment spending and net exports fell slightly," Marcel Thieliant of Capital Economic said in a commentary.

He forecasts that growth will slip to 1.2 percent this year from 1.7 percent in 2017.

Under Prime Minister Shinzo Abe, the world's third-largest economy has picked up steam through a deflation-fighting stimulus program driven mainly by asset purchases by the central bank that are injecting billions of dollars into the economy each year.

The aim has been to keep credit cheap and push prices higher to compel businesses and consumers to spend more. But with wage increases lagging inflation, consumer spending has remained flat, the latest data showed.

Given Japan's reliance on export-led growth, trade friction brought on by President Donald Trump's efforts to trim the perennial U.S. trade deficit has raised uncertainty over the outlook for the economy. Antagonisms between Washington and Beijing over trade also threaten to hurt the economy indirectly given Japan's importance as a source of parts and technology for products made or assembled in China.

Abe's own domestic political problems also could upend his "Abenomics" growth strategy. The prime minister has held office for much longer than most of his predecessors. But his government is contending with scandals over cronyism and sexual harassment that have set off speculation he may be replaced as head of the ruling Liberal Democrats in their next party election.