“All countries run trade deficits whenever they consume more than they produce,” said Kimberly Clausing, an economist at Reed College in Oregon. “And when we borrow to finance tax cuts, like we did with the Tax Cuts and Jobs Act, we make these imbalances worse.”

The trade deficit is the difference between how much a country sells to its trading partners and how much it buys. It generally includes both goods and services, though Mr. Trump has focused almost exclusively on the deficit in goods. He has long boasted that his trade policies would reduce that gap, which he views as a measure of whether partners like China and the European Union are taking advantage of the United States, a diagnosis few economists share.

Instead, in a year in which Mr. Trump imposed tariffs on steel, aluminum, washing machines, solar panels and a variety of Chinese goods, the overall trade deficit grew 12.5 percent from 2017, or nearly $70 billion, to $621 billion, the Commerce Department said Wednesday. Although the United States recorded a trade surplus in services, the trade deficit in goods with the European Union and Mexico grew more than 10 percent as imports rose faster than exports.

In December, the overall deficit in goods and services, which includes everything from computers and washing machines to tourism and intellectual property, rose 19 percent from the previous month, to $59.8 billion. It was the highest monthly trade deficit since 2008, when the American economy was mired in recession.

Several global economic factors explain the widening of the deficit last year. China’s slowdown has reduced consumer appetite for American goods, as has slowing growth in Europe. The strength of the dollar in global currency markets has made it cheaper for American consumers to buy foreign-made goods, and more difficult for foreign customers to buy American-made ones.