Exports exceeded imports by $129 million or 3.6 per cent last month, the first July trade surplus for 20 years.
The annual trade balance was a surplus of $1.3 billion, up from $1 billion in the year ended June.
Exports at $3.7 billion were up 4.7 per cent on July last year, dairy products accounting for nearly half of the increase.
Imports at $3.6 billion were 4 per cent lower on a year ago, lower imports of oil and petroleum products accounting for two-thirds of the difference. Oil shipments are large and irregular and can blow the monthly trade numbers around.
For the three months ended July, exports were 6.5 per cent higher than in the same period last year. This was an impressive increase given that the dollar rose 5.2 per cent in the interval, lowering the domestic price received for exports, Infometrics economist Matt Nolan said.
Imports in the three months to July rose 6.3 per cent on the period last year.
Imports of plant and machinery in the three months were up 11.5 per cent on a year ago, while imports of consumer goods were down 0.6 per cent and cars down by 12.8 per cent.
In the three months to July exports of dairy products were 9.6 per cent up on the same period last year, reflecting a 4.3 per cent increase in volumes as well as higher prices.
Meat exports rose 9.5 per cent in value but volumes fell 3.5 per cent.