Robust exports brought Japan a goods trade surplus of ¥2.99 trillion ($27 billion) in 2017, the second straight year of black ink, even as imports surged amid higher energy prices, government data showed Wednesday.

Exports jumped 11.8 percent to ¥78.29 trillion, reflecting an increase in Asian shipments to a record high, while imports surged 14 percent to ¥75.30 trillion, according to preliminary data from the Finance Ministry.

The surplus, however, was 25.1 percent lower than in 2016.