By Jeffrey T. Lewis

SÃO PAULO -- Brazil posted its biggest trade surplus ever in 2016 as imports plunged amid the country's worst economic recession on record.

The country had a surplus of $4.4 billion in December, bringing the total for the year to $47.7 billion, the trade ministry said Monday. That beats the record of $46.5 billion set in 2006, which was powered by strong demand for exports from Latin America's largest economy.

The surplus last month was smaller than the $4.8 billion surplus posted in November.

With Brazil's gross domestic product estimated to have shrunk 3.5% in 2016, following a 3.8% contraction in 2015, demand at home has slumped.

Brazil imported $137.6 billion worth of goods and services last year, a drop of20% from $171.4 billion in 2015. Purchases of capital goods from abroad slumped as companies held back from investing amid the uncertainty about when economic growth will return.

Consumers also cut back on their spending as unemployment rose , reaching 11.8% in the three month period ending in October, the most recent figure available.

Exports, meanwhile, declined much less in 2016, to $185.2 billion from $191.1 billion the previous year, as prices for commodities including iron ore and coffee recovered.

The outlook for Brazil's economy has gotten gloomier in recent weeks, with many economists cutting their forecasts. A weekly survey by the central bank published earlier Monday showed a median forecast for GDP growth of only 0.5% in 2017, down from a forecast of 0.8% four weeks earlier.

Write to Jeffrey T. Lewis at jeffrey.lewis@wsj.com

(END) Dow Jones Newswires

January 02, 2017 12:54 ET (17:54 GMT)

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