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 percent to $65.0 billion.
Imports of motor vehicles and parts fell 10.8 percent as imports of passenger cars and light trucks fell 18.7 percent after hitting a record high in June.
Exports edged down 0.4 percent in July to $65.7 billion as exports of motor vehicles and parts declined 5.4 percent.
In volume terms, imports fell two percent in July, while exports decreased 1.5 percent.