New Zealand exports and imports hit new highs last year as the country earned more from agricultural products and bought more cars and computers.

Goods exports jumped 11 per cent to $53.7 billion in 2017 from with 2016, while imports increased 9.4 per cent to $56.5b, with both surpassing their previous highs, Statistics New Zealand said. The annual trade deficit narrowed to $2.8b from $3.1b.

China, Asia's largest economy, remained New Zealand's top trading partner for the fourth straight year. New Zealand exports to China surged 27 per cent to $12b in 2017, accounting for 22 per cent of the country's total exports, while imports from China advanced 5.7 per cent to $10.9b, accounting for 19 per cent of New Zealand's total imports.

"China overtook Australia as our top export market in 2013 and has remained at the top every calendar year since," said international statistics manager Tehseen Islam. "The gap between the top two markets is now wider than it's been at any time since then."


Goods exports to Australia lifted 6.5 per cent to $8.8b while imports from Australia also gained 6.5 per cent to $6.9b.

New Zealand is the world's largest exporter of dairy products and has benefited from an increase in global dairy prices over the past year. Dairy products led the country's export gains last year, with the value of milk powder, butter and cheese jumping 25 per cent to $14b.

Exports of meat and edible offal, the country's second-largest commodity export, rose 12 per cent to $6.6b. Meanwhile exports of logs, wood and wood articles, the third-largest group, advanced 13 per cent to $4.7b, Stats NZ said.

On the other side of the ledger, imports of mechanical machinery and equipment such as aircraft parts and computers jumped 19 per cent to $8.2b, while imports of vehicles, parts and accessories, which is a category mostly made up of cars, trucks and vans, rose 16 per cent to $8.9b.

For the month of December, record exports of dairy products drove total exports to their highest ever monthly value, Stats NZ said. Total exports surged 26 per cent to $5.6b, led by a 30 per cent gain in dairy exports to $1.9b. Imports for the month increased 11 per cent to $4.9b, led by a 21 per cent gain in the value of mechanical machinery and equipment such as aircraft parts to $807 million.

The monthly trade balance for December turned to a surplus of $640m from a $1m deficit in the same month a year earlier. The surplus is the largest for any December month, and the largest in any month since March 2015 which recorded a $661m surplus.