By Anthony Harrup

MEXICO CITY -- Mexico's trade deficit narrowed in October from the previous month and from a year earlier as a surplus in trade of non-petroleum goods partially offset the continued petroleum deficit.

Exports fell 4.4% from October 2015 to $32.59 billion, and imports fell 5.9% to $33.49 billion, the National Statistics Institute said Friday. The $900 million deficit was smaller than September's $1.6 billion trade gap, and the $1.5 billion shortfall in the year-earlier month.

The trade deficit has widened over the past two years as a result of low crude oil prices and a decline in Mexican oil-export volume, coupled with increased imports of natural gas, gasoline and diesel, mostly from the U.S., which has turned Mexico into a net petroleum importer. Petroleum accounted for $10 billion of the $13.36 billion trade deficit in the first 10 months of the year. Both exports and imports rose in October.

The non-petroleum trade balance has improved, however, with manufactured goods accounting for 90% of total exports. Mexico had a $106 million surplus in non-petroleum goods trade in October, narrowing the non-oil deficit to $3.37 billion in the first 10 months of the year, the smallest in two decades.

The Bank of Mexico expects the trade deficit to end this year at $15.2 billion, or 1.5% of gross domestic product, but forecasts a narrower $12.6 billion trade gap in 2017.

The central bank's projections acknowledge the risk that the administration of U.S. President-elect Donald Trump could adopt policies that jeopardize cross-border production chains, "even if those policies are contrary to the interests of our northern neighbor itself."

Still, the bank's base-case scenario is that commercial relations between Mexico and the U.S. will continue to work well.

If rising oil prices don't help reduce Mexico's trade deficit, the country will rely on manufactured exports to narrow the gap, hence the risk from U.S. protectionist threats that could lower the benefits to Mexico of a pickup in U.S. industry, UBS said in a recent report.

The peso's roughly 40% depreciation in the past two years hasn't helped manufacturing exports much, partly because Mexico imports many of the components it uses for final assembly. "What matters more than price to Mexican manufacturing volumes is that U.S. demand be strong, and that has not been the case in recent quarters," UBS added.

Mexican exports of factory-made goods fell 6.1% in October from a year before, and were down 2.9% in the first 10 months of the year.

Mr. Trump has said he would seek to renegotiate the NorthAmerican Free Trade Agreement to secure better terms for the U.S., or abandon the agreement which he blames for job and factory losses in the U.S.

He made no mention of Nafta this week, however, when announcing his intention to order a U.S. withdrawal from the Trans-Pacific Partnership on taking office.

The content or scope of a Nafta renegotiation isn't yet clear.

Mexican President Enrique Peña Nieto told reporters this week that his government will discuss a new agenda in the bilateral relationship once Mr. Trump takes office in January, including "sensitive issues" for both sides, but reiterated Mexico's commitment to free trade.

Mexico wants to expand commerce with all 46 countries with which it has trade agreements, but "evidently the agreement with North America will continue to be a central issue," he said.

Mr. Peña Nieto had a controversial meeting with Mr. Trump in Mexico City in late August, during the U.S. presidential campaigns.

Write to Anthony Harrup at anthony.harrup@wsj.com

(END) Dow Jones Newswires

November 25, 2016 10:12 ET (15:12 GMT)

Copyright (c) 2016 Dow Jones & Company, Inc.