The Government ended the last financial year to June 30 with a deficit of $9.2 billion - about half of what it was last year - but up from the $8.4 billion shortfall that was signalled in the May Budget.
The Treasury said the tax take was slightly higher than forecast and the Government's core expenses were lower than forecast.
The write-off in the value of KiwRail by $1.4b on June 27 was not factored into the May Budget forecasts.
Excluding $1.9b in Christchurch earthquake costs, the operating balance would have been $7.3b, compared with $9.3b in the previous year, the Government said.
Treasury officials would not comment on whether the books confirmed the Government was on target to get back into surplus in the 2014-15 financial year.
Bank of New Zealand economist Doug Steel said today's release showed the Government's books were running close to budget.
"There are a lot of wiggles in there because of the earthquake and KiwiRail restructure, but I think it's pretty close to budget,'' he told APNZ.
"So as such there are no surprises,'' Steel said. "We have still got a reasonable deficit on our hands and I still think that returning to surplus is very much a challenge - as it was before - but so far so good,'' he said.
Finance Minister Bill English said the improvement in the Government's fiscal position reflected an increase in tax revenue, as the economy recovered, and lower core expenses, due to a number of factors including costs associated with the Emissions Trading Scheme and the weathertight homes assistance package, and lower Canterbury earthquake recovery costs in the latest year.
But he said financial impact of the Canterbury earthquakes continued to significantly affect the New Zealand economy and the state's finances.
The total expenses relating to the earthquakes totalled $1.9b (net of reinsurance) were in addition to the $9.1b recorded in the previous year.
English said excluding the one-off effects of the KiwRail writedown, the books were better than forecast.
Tax revenue increased by $3.5b from the previous year and core government expenses fell by $1.4b.
Net debt increased to $50.7b (24.8 per cent of GDP) from $40.1b (20.3 per cent) in the previous year.
Revenue increased by $3.5b from the previous year, as the recovering economy underpinned consumption and wages.
Overall, the operating deficit before gains and losses (OBEGAL) of $9.2 billion for the latest year compared with $18.4b the previous year.
When earthquake costs were excluded, the OBEGAL deficit was $7.3b in 2011-12, compared with $9.3b a year earlier.