WASHINGTON (AP) — The deficit in the broadest measure of U.S. trade shrank in the final three months of 2016 but the gap for the full year rose to the highest level in eight years.

The deficit in the current account shrank to $112.4 billion in the fourth quarter, a drop of 3.1 percent from the $116 billion deficit in the third quarter, the Commerce Department reported Tuesday. The improvement reflected stronger earnings by U.S. investors on foreign holdings, which offset a rise in the deficit on goods and services.

The current account deficit for all of 2016 rose 3.9 percent to $481.2 billion, the highest annual figure since 2008. The current account is the most complete measure of trade because it covers not only trade in merchandise and services but also investment flows.

President Donald Trump made reducing America's persistent trade deficits a key component of his successful campaign, contending that the deficits had cost the country millions of well-paying factory jobs. He threatened to slap punitive tariffs on imports from China, Mexico and other nations he accused of trading unfairly.

Economists worry that Trump's threats to erect protectionist barriers could spark an all-out trade war in which foreign nations retaliate by boosting their tariffs on American goods.

The current account report showed that the deficit on goods and services increased by $16.1 billion to $132.2 billion in the fourth quarter but this was offset by a $19.9 billion increase in income from foreign investments, which rose to $61.5 billion in the fourth quarter.