By Paul Kiernan, Wall Street Journal–

The U.S. posted its widest monthly trade gap since 2008 in December and a record annual deficit in goods as sturdy economic growth underpinned higher spending by American consumers and businesses.

The international trade deficit in goods and services widened 19% in December from the prior month to a seasonally adjusted $59.8 billion, the Commerce Department said Wednesday. Economists surveyed by The Wall Street Journal had expected a $57.3 billion gap.

The shortfall grew last year despite President Trump’s aim to reduce it.

Over the course of 2018, Mr. Trump imposed tariffs on a range of goods that the U.S. imports from other countries, particularly China, in hopes of giving American producers a competitive edge. He publicly lambasted companies that outsourced jobs, renegotiated pacts with major U.S. trade partners like Mexico, Canada and South Korea, and rankled longtime European allies by deeming their steel and aluminum exports a threat to national security.

Still, the trade gap swelled 12% from 2017 to $621 billion. Excluding services that the U.S. sells to foreigners, such as tourism, intellectual property and banking, the deficit grew 10% to $891.3 billion, the largest level on record.

Economists say the shortfall was fueled, ironically, by another Trump administration policy: tax cuts and spending increases that juiced demand from U.S. consumers and businesses at a time when growth in the rest of the world was slowing. Concern that the U.S. economy could overheat prompted the Federal Reserve to raise interest rates four times in 2018, contributing to a strong dollar in the second half of the year that made foreign goods relatively cheap for Americans

As a result, U.S. imports grew 7.5%, while exports increased just 6.3%.

“Higher take-home incomes for households have definitely proven to be very conducive to imports,” said Pooja Sriram, an economist at Barclays. “The outcome has been in almost the opposite direction of what the administration has wanted.”

U.S. imports of consumer goods last year jumped 7.7% to $647.9 billion, fueled in part by a 22% rise in inbound shipments of drugs. Industrial supplies like fuel and crude oil were another driver of the trade gap, with imports rising 13% from 2017 to $575.7 billion.

Highlighting the limitations of Mr. Trump’s trade policies, the goods deficit widened most with China, the U.S.’s largest commercial partner and the main focus of White House efforts. That is partly because Chinese authorities responded to tariffs by drastically scaling back their country’s purchases of key U.S. exports like soybeans, cars and metals, production of which is concentrated in states that Mr. Trump won in the 2016 election.

U.S. goods exports to China fell 7.4% in 2018 to $120.3 billion, while imports from China grew 6.7% to $539.5 billion as Americans increased their purchases of electronics, furniture, toys and other products.

But the deficit in goods also widened in other countries where Mr. Trump aimed his trade war, including the European Union and Mexico.

Most economists disagree with Mr. Trump’s strategy of targeting a reduction in the trade deficit, saying it merely reflects underlying economic forces. But deficits do subtract from gross domestic product, and the widening of the trade shortfall at the end of 2018 was a factor in slower U.S. growth in the fourth quarter.

Andrew Hunter, an economist at Capital Economics, said that’s likely to continue in early 2019 with imports set to grow while weaker global demand weighs on exports.

“Trade now looks set to be a more serious drag in the first quarter,” Mr. Hunter said in a note to clients. He estimates annualized GDP growth will slow to just 1.5% in the first three months of 2019, down from 2.6% in the fourth quarter.

Write to Paul Kiernan at paul.kiernan@wsj.com