Last month's trade deficit was an unexpectedly small $472 million as imports exceeded exports by 13 per cent.
Market economists had been looking for a deficit of $1.1 billion.
Trade flows are always in the red in August but the latest deficit compares with an average 24 per cent of exports over the previous five Augusts.
When adjusted for seasonal effects it was a surplus of $328 million, Statistics New Zealand said, boosted by higher volumes for exports of dairy products, meat, fruit and seafood.
August last year recorded a trade deficit of $1.2 billion, but that included the importation of an oil rig and of $120 million more crude oil than last month, while the latest monthly balance also benefited from $100 million more of live animal exports.