Japan's economy rebounded to grow 0.8 percent in the second quarter, government data showed Thursday, in welcome news for Japan's next prime minister following Fumio Kishida's decision to step down.

The rebound came after the economy shrank 0.6 percent -- adjusted upwards from an earlier figure of minus 0.7 percent -- in the first quarter to March.

The rise, due to increases in production along with capital and public investment, beat market expectations of a 0.6 percent expansion for the world's number four economy.

"Consumer sentiment should have improved because real wages have turned positive as promised wage increases start to get paid to workers," Hiroyuki Ueno, chief strategist at SuMi Trust, said before the data's release.

"In addition, the recovery in shipments by some automakers, some of which were suspended temporarily in May, will also have been a positive boost for consumer spending."

Auto production gradually resumed in the quarter after months of suspensions due to scandals that affected firms across the industry, a major economic driver for Japan.

Toyota subsidiary Daihatsu in particular halted production for months from late 2023 after admitting it had engaged in safety test irregularities for years.

Thursday's economic news comes a day after Kishida said he would step down next month after dropping out of the race to retain the leadership of his party.

Kishida's poll ratings had tumbled since taking office almost three years ago because of price rises that have eaten into Japanese incomes and a slew of scandals.

The yen also fell sharply and the economy struggled to gain traction despite major stimulus efforts including tax cuts by Kishida's government.

Kishida could in theory have governed until 2025, and there had been speculation he might call a snap election to shore up his position.

But analysts said he decided to throw in the towel after losing support within the Liberal Democratic Party (LDP), which has ruled Japan almost without a break for decades.

Several figures have been mooted as possible successors including digital minister Taro Kono and economic security minister Sanae Takaichi, who would be Japan's first female premier.

Others include Shigeru Ishiba, former party number two, and Shinjiro Koizumi, former environment minister and son of ex-premier Junichiro Koizumi.

Kishida also announced big spending plans including for defence and efforts to reverse Japan's creeping demographic crisis, but it remains unclear how these will be funded.

He won plaudits abroad while in office, siding decisively with Ukraine after Russia's invasion and, with US encouragement, moving to make Japanese defence policy more muscular to counter China.

His leadership has been "nothing short of historic", US President Joe Biden said in a statement.

"Guided by unflinching courage and moral clarity, Prime Minister Kishida has transformed Japan's role in the world," Biden said, praising his moves on national security, support for Kyiv and strengthening "trilateral cooperation" between the United States, Japan and South Korea.