WASHINGTON – The U.S. trade deficit climbed in May as a surge in imports of Chinese-made cellphones and computers pushed the politically sensitive imbalance with China to the highest level in six months.

The trade deficit rose to $41.1 billion in May compared to April’s $37.4 billion, the Commerce Department reported Wednesday. It was the largest imbalance since February.

Exports, which have struggled this year because of a strong dollar and weak growth in overseas markets, edged down 0.2 percent to $182.4 billion. Imports jumped 1.6 percent to $223.5 billion.

America’s deficit with China jumped 19.4 percent to $29 billion, the largest imbalance since November. Presumptive Republican presidential nominee Donald Trump has accused the Obama administration of failing to protect U.S. workers from unfair trade practices in China and other countries.

Trump has sought to tap into the economic anxiety of Americans who have seen jobs disappear in an increasingly global economy. In a recent trade speech, Trump said he would exit from the North American Free Trade Agreement with Canada and Mexico if it was not renegotiated, kill the pending Trans-Pacific Partnership trade agreement and take a more aggressive approach to China’s trade practices, which he said were costing American jobs.

The U.S. Chamber of Commerce, normally an ally of Republicans on trade, charged that Trump’s approach would cost 3.5 million U.S. jobs and result in higher prices for American consumers and a weaker economy. Trump said he would brand China a currency manipulator, a charge which could lead to trade sanctions if negotiations with China did not resolve the issue.

Through the first five months of this year, the deficit is running 3.5 percent below the same period in 2015, a year in which America’s deficit in goods and services trade rose 2.1 percent to $500.4 billion. The lower deficit so far this year reflects the fact that while U.S. exports are down, imports are down by a larger amount, reflecting in large part lower oil prices.

For May, oil imports increased 8.4 percent to $11.1 billion, reflecting a rebound in prices during the month. The average price for a barrel of crude oil rose $4.71 to $34.19, the biggest one-month increase since a $5.55 rise from April to May in 2011.

Even with the gain, the average price for a barrel of crude is still $16.57 below the price a year ago.

The deficit with China is running 6.4 percent below last year’s pace, although the deficit is still the largest with any single country.

The deficit with the European Union rose 12.6 percent to $13.4 billion in May. America’s trade relationship with the 28 nation EU could undergo a significant change if Britain goes ahead with a decision by British voters on June 23 to exit the EU.

U.S. export sales this year have been hurt by a strong dollar, which makes American products more expensive in overseas markets. The dollar had been weakening slightly but has strengthened following the British vote as foreign investors have sought the safety of U.S. investments.