Canada’s trade deficit with the rest of the world rose to an all-time record high in July, Statistics Canada data shows.

Canada bought $2.3 billion more from foreign countries than it sold to them in July, as exports fell 3.4 per cent from the previous month. Imports also fell, but by a smaller 2.2. per cent, meaning the overall trade deficit grew wider.

The trend went against analysts’ predictions, who expected a slight narrowing of the deficit.

"It’s never encouraging to see a deteriorating trade balance, but it’s really bad news when the worsening is sparked by falling two-way trade," CIBC analyst Emanuella Enenajor said in a client note Tuesday morning.

TD Bank economist Leslie Preston suggested the weak number for energy exports — they fell 8.5 per cent during the month — are a little "suspicious," and predicted a bounce-back in August.

"However, that does not account for the weakness seen in other non-energy categories. There is really little to be positive about in today’s report," Preston wrote.

Exports to the United States fell 5.0 per cent to $27.4 billion in July, while imports declined 2.1 per cent to $25.3 billion.

The trade surplus with the United States decreased to $2.1 billion in July from $3 billion in June, the smallest surplus since October 2010.

Imports from countries other than the United States decreased 2.4 per cent to $14.7 billion in July while exports rose 1.2 per cent to $10.3 billion leaving the trade deficit at $4.4 billion, down from $4.9 billion in June.

With files from The Canadian Press

Also on HuffPost:

Loading Slideshow...
  • 20: Australia

    Source: <a href="http://www3.weforum.org/docs/CSI/2012-13/GCR_Rankings_2012-13.pdf" target="_hplink">World Economic Forum</a>

  • 19: South Korea

    Source: <a href="http://www3.weforum.org/docs/CSI/2012-13/GCR_Rankings_2012-13.pdf" target="_hplink">World Economic Forum</a>

  • 18: Saudi Arabia

    Source: <a href="http://www3.weforum.org/docs/CSI/2012-13/GCR_Rankings_2012-13.pdf" target="_hplink">World Economic Forum</a>

  • 17: Belgium

    Source: <a href="http://www3.weforum.org/docs/CSI/2012-13/GCR_Rankings_2012-13.pdf" target="_hplink">World Economic Forum</a>

  • 16: Austria

    Source: <a href="http://www3.weforum.org/docs/CSI/2012-13/GCR_Rankings_2012-13.pdf" target="_hplink">World Economic Forum</a>

  • 15: Norway

    Source: <a href="http://www3.weforum.org/docs/CSI/2012-13/GCR_Rankings_2012-13.pdf" target="_hplink">World Economic Forum</a>

  • 14: Canada

    Source: <a href="http://www3.weforum.org/docs/CSI/2012-13/GCR_Rankings_2012-13.pdf" target="_hplink">World Economic Forum</a>

  • 13: Taiwan

    Source: <a href="http://www3.weforum.org/docs/CSI/2012-13/GCR_Rankings_2012-13.pdf" target="_hplink">World Economic Forum</a>

  • 12: Denmark

    Source: <a href="http://www3.weforum.org/docs/CSI/2012-13/GCR_Rankings_2012-13.pdf" target="_hplink">World Economic Forum</a>

  • 11: Qatar

    Source: <a href="http://www3.weforum.org/docs/CSI/2012-13/GCR_Rankings_2012-13.pdf" target="_hplink">World Economic Forum</a>

  • 10: Japan

    Source: <a href="http://www3.weforum.org/docs/CSI/2012-13/GCR_Rankings_2012-13.pdf" target="_hplink">World Economic Forum</a>

  • 9: Hong Kong

    Source: <a href="http://www3.weforum.org/docs/CSI/2012-13/GCR_Rankings_2012-13.pdf" target="_hplink">World Economic Forum</a>

  • 8: United Kingdom

    Source: <a href="http://www3.weforum.org/docs/CSI/2012-13/GCR_Rankings_2012-13.pdf" target="_hplink">World Economic Forum</a>

  • 7: United States

    Source: <a href="http://www3.weforum.org/docs/CSI/2012-13/GCR_Rankings_2012-13.pdf" target="_hplink">World Economic Forum</a>

  • 6: Germany

    Source: <a href="http://www3.weforum.org/docs/CSI/2012-13/GCR_Rankings_2012-13.pdf" target="_hplink">World Economic Forum</a>

  • 5: Netherlands

    Source: <a href="http://www3.weforum.org/docs/CSI/2012-13/GCR_Rankings_2012-13.pdf" target="_hplink">World Economic Forum</a>

  • 4: Sweden

    Source: <a href="http://www3.weforum.org/docs/CSI/2012-13/GCR_Rankings_2012-13.pdf" target="_hplink">World Economic Forum</a>

  • 3: Finland

    Source: <a href="http://www3.weforum.org/docs/CSI/2012-13/GCR_Rankings_2012-13.pdf" target="_hplink">World Economic Forum</a>

  • 2: Singapore

    Source: <a href="http://www3.weforum.org/docs/CSI/2012-13/GCR_Rankings_2012-13.pdf" target="_hplink">World Economic Forum</a>

  • 1: Switzerland

    Source: <a href="http://www3.weforum.org/docs/CSI/2012-13/GCR_Rankings_2012-13.pdf" target="_hplink">World Economic Forum</a>