The U.S. trade deficit rose to a five-month high in May as the politically sensitive imbalances with China and Mexico widened.

The Commerce Department said Wednesday that the gap between the goods and services the U.S. sells and what it buys from foreign countries rose 8.4% to $55.5 billion in May, the highest since December. Exports increased 2% to $210.6 billion on rising shipments of soybeans, aircraft and cars. But imports climbed more — 3.3% to $266.2 billion — on an increase in crude oil and cellphones.

The deficit in the trade of goods with Mexico rose 18.1% to a record $9.6 billion. The goods gap with China widened 12.2% to $30.2 billion.

President Donald Trump has sought to reduce America’s persistent trade deficit, which he sees as a sign of economic weakness and the result of bad trade agreements crafted by naive U.S. negotiators. He has slapped tariffs on foreign steel, aluminum, dishwashers, solar panels and on thousands of Chinese goods. He also has renegotiated a trade pact with Canada and Mexico that awaits approval by Congress.

And his team has conducted 11 rounds of talks with China aimed at pressuring Beijing to curb its aggressive push to challenge American technological dominance, an effort that allegedly includes cybertheft and forcing foreign firms to hand over trade secrets.

Mainstream economists say the trade gap is the product of economic factors that don’t respond much to changes in trade policy: Americans buy more than they produce, and imports fill the gap. And a persistently strong U.S. dollar also puts American exporters at a price disadvantage overseas.

So far this year, the goods-and-services deficit is $261.4 billion, up 6.4% from January-May 2018.

In May, the United States ran a $76.1 billion deficit in the trade of goods such as appliances and cars. That was partially offset by a $20.6 billion surplus in the trade of services such as banking and tourism.

© The Associated Press. All rights reserved.