The trade deficit for August of $472 million was the smallest for that month since 2010.
The government statistician says the value of exports rose by 6.9% to $3.5 billion compared with August last year.
Exports of live animals rose by $94 million - all going to China - followed by a $91 million increase in exports of milk powder, butter and cheese.
Imports were greater than at $4 billion, although they fell 12 percent, but were boosted in August last year by a large one-off drilling platform.
Excluding that oil rig, imports fell 7.9%, led by falls in crude oil, fertilisers and consumer goods such as clothing, domestic appliances and cars.
Westpac economist Anne Boniface said today the deficit was smaller than the market had been expecting.
"For us, the main surprise was on the import side of the ledger. The import volumes were a bit weaker than what we had pencilled in.
"Monthly trade data can be quite volatile and, in particular, some import categories are quite
volatile ... things like crude oil, petrol, car imports are particularly weak in August and these numbers can bounce around from month to month," she said.
"On the export side of the ledger, dairy export receipts seemed to be quite strong this month. However, we wouldn't expect that to last long because we've seen global dairy auctions showing further decline in dairy prices in recent weeks. So we expect that to be temporary and overall, we'd expect declining dairy export revenues to weigh on the trade data for some time yet."