Statistics Canada says the country posted a merchandise trade surplus of $684 million in July.
The result compared with a revised deficit of $179 million in June. The initial reading for June had shown a surplus of $638 million.
In July, Statistics Canada says imports fell 1.7 per cent to $65.0 billion.
Imports of motor vehicles and parts fell 10.8 per cent as imports of passenger cars and light trucks fell 18.7 per cent after hitting a record high in June.
Exports edged down 0.4 per cent in July to $65.7 billion as exports of motor vehicles and parts declined 5.4 per cent.
In volume terms, imports fell two per cent in July, while exports decreased 1.5 per cent.