Good coming into the USA from China, Mexico and the European Union all hit record levels, which boosted the trade gap to $48.7 billion - from $44.9 billion in September- and is the highest since President Trump took office in January.
Statistics Canada said Tuesday that exports increased 2.7 per cent as imports fell 1.6 per cent for the month, shrinking the country's trade deficit compared with the $3.4-billion shortfall in September.
Exports rose across nearly all sectors to $44.5 billion after shrinking for the past four months.
Exports of basic and industrial chemical, plastic and rubber products gained 12.4 per cent, while metal and non-metallic mineral products increased 4.5 per cent.
Canada's merchandise trade deficit narrowed more than expected to $1.5 billion in October as exports improved for the first time since May.
The Canadian dollar CAD=D4 initially edged up after the data, rising to C$1.2626 to the USA dollar, or 79.20 US cents, from C$1.2648, or 79.06 USA cents, before the data were released.
The mounting trade deficit comes the administration of President Donald Trump enters the latter stages of fraught negotiations with Mexico and Canada to revamp the North American Free Trade Agreement. America's deficit means that it is importing more than it is exporting, which can hinder economic growth. He blames them on bad trade deals and abusive practices by China and other trade partners.
So far this year, the United States is running a trade deficit of $462.9 billion, up 11.9 percent from a year earlier. Shipments from Mexico were also the highest ever, causing the US gap with that country to expand in October.
In October, the United States ran a surplus of $20.3 billion with the rest of the world in services such as banking and tourism. The deficit was the lowest since the C$1.02 billion seen in May.
Especially strong was the rise in energy exports, primarily to the U.S. Exports of gasoline blending stock were up 44.5 per cent and diesel and fuel oils exports rose 18.4 per cent after a recent drawdown in U.S. inventories of refined petroleum products.