Photo/IllutrationContainer trucks leave a cargo terminal at a port in Tokyo on Jan. 24. (AP Photo)

Japan's trade surplus fell by 25 percent in 2017 from a year earlier though a recovery in exports to China and the United States helped provide a strong tailwind for the economy.

Preliminary data released Wednesday showed exports rose 11.8 percent in 2017 to 78.3 trillion yen ($712 billion) while imports surged 14 percent from the year before to 75.3 trillion yen, pushed higher by a recovery in oil prices. That took the trade surplus to about 3 trillion yen.

In December, exports climbed 9 percent year-on-year to 7.3 trillion yen while imports jumped 15 percent to 6.9 trillion yen. The 359 billion yen surplus was down 44 percent from the same month in 2016.

Exports to China jumped 20.5 percent last year to 14.9 trillion yen, mainly thanks to strong shipments of industrial machinery and chemicals. Exports to Asia as a whole jumped nearly 16 percent to 42.9 trillion yen.

While Japan runs a perennial trade deficit with China, its trade surplus with all of Asia jumped 52 percent to 5.9 trillion yen, second only to its politically tricky 7.04 trillion yen surplus with the United States, its largest export market and ally.

Exports to the United States climbed 6.8 percent from a year before in 2017 to 15.1 trillion yen, largely driven by shipments of cars and other vehicles, parts and other transport equipment that accounted for 40 percent of the total.

Japan's imports from the United States rose 10 percent to 8.08 trillion yen last year, with strong growth in shipments of coal and oil, ore and food.

The rebound in demand from other major economies has been a boon for Japan's manufacturers. Preliminary results from the Nikkei monthly survey of purchasing managers released Wednesday showed surging new orders helped push factory activity in January to its fastest pace in nearly four years.