By David Ljunggren

OTTAWA (Reuters) -Canada posted a trade surplus of C$3.13 billion ($2.45 billion) in November, the largest in over 13 years, with record exports offsetting the impact of floods in British Columbia, Statistics Canada said on Thursday.

Analysts polled by Reuters had forecast a November surplus of C$2.03 billion. Exports and imports hit all-time highs for the second month in a row, pushing the surplus to a level not seen since the C$3.45 billion posted in September 2008.

Peter Hall, chief economist at Canada’s export development agency, said the data showed how much global production had recovered from the COVID-19 pandemic.

“The economy has come roaring back much more quickly and much more decidedly than anybody expected or was prepared for,” he said by phone, noting that energy exports had posted a 2.8% gain. Canada is a major exporter of crude and natural gas.

Overall exports rose by 3.8% from October, helping outweigh the impact of massive floods and landslides in British Columbia last November that temporarily cut most links to Vancouver, the country’s largest port.

“This suggests there are modest upside risks to the preliminary estimate that GDP rose by 0.3% month on month in November,” Stephen Brown, senior Canada economist at Capital Economics, said in a note.

Statscan said the data had been inflated by unusually high pharmaceutical shipments. In November, Canada imported COVID-19 medication for packaging and labeling and then exported it.

But even when pharmaceuticals were stripped out, overall exports still grew by 2.8% from October. Imports grew by 2.4% but that shrank to 0.1% excluding pharmaceuticals.

The Canadian dollar was trading 0.1% lower at 1.2762 to the greenback, or 78.36 U.S. cents, as investors weighed the possibility of faster-than-expected U.S. interest rate hikes.

($1 = 1.2762 Canadian dollars)

(Additional reporting by Steve Scherer and Dale Smith in Ottawa and Fergal Smith in Toronto;Editing by Toby Chopra and Nick Zieminski)