Statistics Canada released the trade data on Wednesday. Canada's trade deficit narrowed to C$0.48 billion in June from a deficit of C$3.37 billion in May. May's figure was revised down from a deficit of C$3.34 billion.
Analysts had expected a trade deficit of C$2.8 billion.
The decrease in deficit was driven by an increase in exports. Exports jumped 6.3% in June.
Exports of energy products climbed by 3.7% in June, exports of consumer goods jumped 17.2%, while exports of metal and non-metallic mineral products soared 10.8%.
Imports fell 0.6% in June.
Imports of aircraft and other transportation equipment and parts dropped by 19.0% in June, imports of metal and non-metallic mineral products rose 3.6%, while imports of energy products plunged 10.4%.