The Mexican economy has teetered on the verge of recession during the past year, crimping demand for goods imported from abroad, which has helped to swell the trade surplus.

Exports have held up better. But they too have softened in recent months, albeit without declining as fast as imports. A net surplus in exports helps make a positive contribution to gross domestic product (GDP) in national accounts.

Exports fell 2.1% in December in adjusted terms compared to the same month a year earlier, the fourth consecutive annual decline, figures published by statistics agency INEGI showed.

By contrast, imports to Mexico slipped by 5.1% on the year in December for a seventh month in succession.

The weakness of imports has widened Mexico's current account and reduced local demand for U.S. dollars, lifting the peso currency against the greenback.

However, weak investment has held back domestic demand, and a poll by Reuters this week forecast the economy had contracted 0.1% in the fourth quarter.

Mexico will publish a preliminary estimate for fourth-quarter gross domestic product on Thursday.

In adjusted terms, Mexico's trade surplus was around $6.1 billion last year, the highest since 1996, INEGI data show. That compared with a trade deficit of some $13.3 billion in 2018.

In unadjusted terms, Mexico posted a trade surplus of nearly $3.1 billion in December, the data showed.

"Going forward, the non-oil trade balance is likely to continue to benefit from a competitive currency, weak final domestic demand conditions (particularly investment), and the forecast firming of external demand," said Goldman Sachs economist Alberto Ramos in a note to clients.

(Reporting by Dave Graham; Editing by Bernadette Baum)