Japan’s economy expanded faster than expected last quarter, avoiding a recession and giving embattled Prime Minister Shigeru Ishiba some rare good news as he fends off calls to resign following last month’s historic election setback.

Gross domestic product grew at an annualized pace of 1% in the three months through June from the prior period, surpassing economists’ forecast of a 0.4% gain, the Cabinet Office reported Friday. This followed a revision to the previous quarter’s results to 0.6% growth, reversing from a preliminary contraction.

Gains were led by domestic demand, with business investment rising 1.3%, surpassing the consensus estimate of 0.7% growth, and private consumption nudging higher.