New York (CNN) — For the past two decades, the United States imported more goods from China than all other nations. That’s no longer the case.

Mexico is now the top exporter of goods into the US, according to new trade data released by the Commerce Department on Wednesday.

Mexico sent $475.6 billion worth of goods into the US last year, a 5% increase from 2022. China, meanwhile, exported $427.2 billion worth of goods to the US last year, a 20% slump from 2022.

As a whole, the total US trade deficit in goods and services — a measure of the difference between exports and imports — was $773.4 billion last year, a 19% decline from 2022. That’s the largest annual decline in the trade deficit since 2009.

Contributing to the overall trend was a weaker dollar that’s made the cost of US goods cheaper abroad, Matthew Martin, US economist at Oxford Economics, said in a note Wednesday.

Brad Setser, an economist and senior fellow at the Council on Foreign Relations, suggested in a post on X that tariffs the Trump administration put in place have negatively impacted the amount of goods the US imports from China.

At the same time, Americans have been dialing back on purchases of goods such as electronics that are widely produced in China since supply chain bottlenecks cleared up after the pandemic took hold. In turn, more spending has shifted to services like travel and entertainment.

(Copyright (c) 2024 CNN. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed.)

Join our Newsletter for the latest news right to your inbox