Japan logged a goods trade deficit of ¥1.2 trillion ($11 billion) in 2018, government data showed Wednesday, the first red ink in three years as the cost of energy imports surged.

Imports rose 9.7 percent from a year earlier to ¥82.69 trillion, outpacing a 4.1 percent increase in exports to ¥81.49 trillion.

For December alone, exports marked their steepest fall since October 2016, down 3.8 percent to ¥7.02 trillion, and shipments to China, Japan's largest trading partner, sank 7 percent from a year earlier amid slumping demand for devices from Chinese makers of mobile phones, semiconductors and liquid crystal displays.