The U.S. trade deficit fell by nearly 15 percent in January as higher tariffs held back imports from China and the price of oil fell.

The deficit in goods and services dropped to $51.1 billion from a revised $59.9 billion in December, the Commerce Department said Wednesday. That was the narrowest trade gap in five months and smaller than the $57.3  billion economists expected.

The trade deficits in goods with China fell to $33.2 billion as imports from the nation plunged 12.3 percent.

The U.S. tends to run a deficit in goods and a surplus in services, meaning we import more goods than we export but export more services than we import. The goods deficit narrowed to $73.3 billion in January, while the surplus in services climbed slightly to $22.1 billion.

A ten percent tariff on $200 billion of Chinese goods was imposed at the end of September and was set to rise to 25 percent on January 1. Nonetheless, the trade deficit hit the highest level in a decade in December, suggesting that importers had rushed to bring in goods from  China ahead of the hike to 25 percent.

Some highlights:

For the year, the trade deficit in 2018 rose $621 billion, the highest level in 10 years. That was largely due to a strengthened U.S. economy that boosted U.S. domestic demand and global economic weakening that depressed demand for U.S. exports. Retaliatory tariffs from China also weighed on some U.S. exports.

The January data was delayed for three weeks because of the partial government shutdown.