The US trade deficit hit $55.5 billion in October, the highest since October 2008.

The increase in the deficit is the result of continued growth in imports, while exports actually fell.

The trade deficit with China also hit a record level.

One of President Donald Trump's goals for the trade war was to reduce the trade deficit, but the president's own policies are likely in part prompting the widening gap.

Shrinking the US trade deficit has been a key goal of President Donald Trump's trade war.

But the US Census Bureau announced Thursday that the US trade deficit grew to $55.5 billion in the month of October, the highest in exactly 10 years. That was a 1.7% jump from September, as imports rose by 0.2% and exports fell by 0.1%.

Trump has long been focused on the trade deficit as a signal that his administration's tariffs on Chinese goods and metals are working, despite the fact that most economists discount the measure as a sign of effective trade policy.

Looking at the main target of the trade war, China, the trade deficit was similarly dismal. The unadjusted goods trade deficit hit $43.1 billion in October, the highest level ever.

While Trump may not like the results, there are good reasons the trade deficit is expanding. And part of the blame lies in the president's own policies.

On the import side of the ledger:

The US economy is stronger, and US consumers' appetite is outpacing the country's ability to produce the goods they want.

This means the US needs goods from other countries to satisfy consumer demand, leading to import growth.

The increase in demand is in part because of the significant amount of fiscal stimulus injected into the economy by Trump's tax cuts and the massive bipartisan budget deal.

Goosing the economy, while helping Trump claim victories on things like a stronger GDP, also means the president's trade report card looks worse.

At the same time, exports are cooling because of retaliatory tariffs on US products:

For example, soybean exports to China — a major chunk of US agricultural exports — have collapsed as a result of the trade war.

The trade policy exacerbates the existing issues that were already causing weak export growth, Ian Shepherdson, chief economist at Pantheon Macroeconomics, wrote Thursday.

"The stronger dollar and slower growth in China and Europe are hurting exports, and the tariffs are a real problem too; exports of soybeans fell by $0.8 billion to a four-year low, down 43% year-over-year," Shepherson said.

Read more: The US-China trade war might still rage on despite a breakthrough deal between Trump and Xi

Those existing drags on exports — the strong US dollar and slowing economic growth in foreign countries — and the tariffs combine to make the perfect recipe for weakness on that side of the deficit ledger.

"Moderating global momentum, the stronger dollar, and protectionist trade policies will keep weighing on exports in the near-term, while sturdy domestic demand and limited spare capacity keep import growth healthy — further widening the deficit," said Jack McRobie and Gregory Daco, economists at Oxford Economics.

A few things could turn around the deficit situation. If the US economy were to cool off, as many economists expect, it could slow the pace of import growth. At the same time, if Trump is able to strike a trade deal with China, a prospect of which economists and experts are more skeptical, export growth could rebound and close the gap.