The New Zealand economy grew by 1.0 per cent over the June quarter, making for a 2.7 per cent gain over the June year, Stats NZ said.
The outcome compares with a Reserve Bank forecast of a 0.5 per cent gain in Gross Domestic Product (GDP) over the June quarter, and market expectations of a 0.8 per cent quarterly increase.
The Kiwi dollar increased as a result.
Stats NZ said growth across 15 of the 16 industries contributed to the largest quarter-on-quarter increase in two years.
A 1.0 per cent increase in the service industries was the biggest contributor to growth this quarter, it said.
The goods-producing industries were up 0.9 per cent following a flat March 2018 quarter.
The primary industries grew 0.2 per cent, with strong growth in agriculture, forestry, and fishing offset by a significant fall in mining, it said.
The report follows a series of business of confidence surveys that have pointed a slight cooling of the economy.
Reserve Bank Governor Adrian Orr, in last month's monetary policy statement, said the bank expected to keep its official cash rate steady at 1.75 per cent through
2019 and into 2020 - longer than the bank had projected in May.
Orr said then that while recent economic growth had moderated, the bank expects it to pick up pace over the rest of this year and be maintained through 2019.
The New Zealand dollar bumped up to US66.4c from US66.06 just before the release of the data.
The release of the latest GDP figures were preceded by some controversy earlier this week when Prime Minister Jacinda Ardern suggested on Newstalk ZB that she had been given a "hint" of the figures ahead of the release.
Government Statistician Liz MacPherson said at the time there are "absolutely not" any hints to anyone, including the Prime Minister, before the release of economic growth figures from Stats NZ.
Westpac said the data showed encouraging signs for the economy.
"Not only was the overall result stronger than expected, the details were more encouraging for the economy's growth prospects going forward," Westpac economists said in a note.
"We expected a solid underlying picture, but with some one-offs that would boost the growth rate in the June quarter," the bank said.
"Instead, growth was shared widely across the economy, and the one-offs – in areas such as electricity, transport and government services – weren't as big as we expected, which means there's less risk of an unwind in the next quarter," it said.
Westpac said the result was significant for the Reserve Bank's official cash rate decision next Thursday.
Capital Economics said the bigger than expected jump in GDP growth will give the Reserve Bank hope that the consumer and business gloom is overdone and that growth would "reaccelerate" next year.