Exports fell for the third straight month in June, narrowing Canada's trade surplus with the rest of the world, Statistics Canada said Tuesday.

The trade surplus fell to a lower-than-expected $5.3 billion, down from $5.9 billion the month before. Analysts had been expecting the surplus to drop to $5.6 billion.

Lower exports of machinery and equipment accounted for much of that drop.

Exports of automotive products also fell — the third monthly drop for that sector. "Some plants closed earlier than usual in preparation for the production of new models," Statistics Canada said.

The Canadian dollar was hovering near the 95-cent US mark for much of June. A higher loonie makes Canadian exports more expensive in the United States.  

The trade surplus also shrank because imports rose for the first time since March.

Statistics Canada said the country imported $34.1 billion worth of goods in June, up $200 million from May.

"The increase was largely attributable to robust growth in imports of industrial goods and materials," the agency said.

Canada's trade surplus with the United States remained virtually unchanged at $7.7 billion, as imports from and exports to Canada's biggest trading partner rose by about the same amount.

The Canadian dollar fell 1.20 cents to close at 93.75 cents US.

U.S. trade deficit unexpectedly narrows

Meanwhile, the U.S. trade deficit shrank to $58.1 billion US in June from $59.2 billion in May — surprising market observers who had been predicting it would widen to $61 billion.

U.S. exports of goods and service rose 1.5 per cent to a record $134.5 billion while U.S. imports rose 0.5 per cent — largely because of higher oil prices and more imports of computers.