OTTAWA -- Canada posted a second consecutive monthly trade surplus for the first time in more than two years in December, but booming oil exports obscured weakness in some key sectors.

The $923 million surplus announced by Statistics Canada on Tuesday exceeded analysts' forecasts of a $350 million positive balance. Statistics Canada revised November's surplus up to $1.01 billion from an initial $0.53 billion.

Canada last recorded back-to-back monthly trade surpluses in August and September 2014.

But while overall exports rose by 0.8 per cent in December, export volumes actually fell by 1.4 per cent.

"This wasn't a good news story in the most recent month ... the feed through to December real GDP from these data will be on the soft side," said Avery Shenfeld of CIBC Economics.

Energy product exports jumped by 15.9 per cent, the biggest month-on-month leap in six years, on strength in crude oil and bitumen.

“December trade was all about oil,” wrote CIBC Economist Nick Exarhos in a report to clients. “We don’t see energy providing as dramatic a catalyst to the trade balance ahead.”

Exports of motor vehicles and parts fell 5.2 per cent to the lowest level since June 2015. Statistics Canada said a higher proportion of Canadian-produced motor vehicles were destined for the domestic market.

Peter Hall, chief economist at Export Development Canada, noted there was no sign of a let-up in U.S. demand for autos and said overall he was pleased with the trade data.

"This gives us good momentum going into 2017," he said.

“Going forward, exports are expected to gain some momentum, with U.S. demand expected to remain healthy and the loonie unlikely to move much from its recent mid-70 US cent range," TD Economist Dina Ignjatovic wrote in a report to clients. "However, with NAFTA renegotiations being a key priority for [U.S.] President Trump, the overall outlook for trade has been clouded. But, while the risks are certainly tilted to the downside, it will likely take some time before any potential measures are put into action.”

The December figures could prompt some reflection at the Bank of Canada, which has long fretted about weak non-energy exports and is waiting to see what the new U.S. administration does about trade.

Last month, the central bank said "prospective protectionist trade measures in the United States would have material consequences for Canadian investment and exports."

Imports increased 1.0 per cent on higher imports of aircraft and other transportation equipment as well as metal products. Volumes rose by 0.4 per cent.

Exports to the United States, which accounted for 73.6 per cent of all Canadian exports in December, grew by 0.2 per cent while imports rose by 1.3 per cent. As a result, Canada's trade surplus with the United States slipped to $4.42 billion from $4.74 billion in November.

BMO Senior Economist Jennifer Lee reckons Canada and Mexico “likely breathed a sigh of relief” as their deficits with the U.S. slipped in the final month of 2016.

“These days, international trade reports are scrutinized, not just for their impact on GDP, but the political ramifications as well,” she wrote in a report to clients. “Running deficits with the U.S. will draw unwanted attention from the Administration, but [Tuesday’s data] won’t be held responsible.”

The Canadian dollar strengthened slightly to  $1.3170 to the U.S. dollar, or 75.93 U.S. cents, compared to  $1.3190, or 75.82 U.S. cents, before the data were released.

Separately, Statistics Canada said the value of building permits issued in December dropped by 6.6 per cent on weakness in the residential and non-residential sectors.

--With files from BNN