Japan logged an annual trade deficit in 2011 for the first time in 31 years, Ministry of Finance data showed on Wednesday, as last year's earthquake and tsunami, weak global demand and a strong yen battered exports.

The trade deficit stood at 2.49 trillion yen ($32 billion)in 2011, the first annual deficit since 1980.

In December, Japan's exports fell 8.0 percent from a year earlier, down for a third straight month. The fall was in line economists' median forecast for a 7.9 percent drop, and followed a 4.5 percent decline in the year to November.

Imports rose 8.1 percent in December from a year earlier, also in line with a median forecast for an 8.0 percent gain.

(Reporting by Kaori Kaneko; Editing by Edwina Gibbs)