The U.S. Commerce Department released the trade data on Tuesday. The U.S. trade deficit widened to $41.87 billion in May from a deficit of $40. 7 billion in April. April's figure was revised up from a deficit of $40.88 billion.
Analysts had expected a trade deficit of $42.6 billion.
The rise of a deficit was driven by lower exports. Exports fell by 0.8% in May, while imports decreased by 0.1%.
A stronger U.S. dollar weighs on exports as it makes U.S. goods and services less affordable abroad. Weak overseas demand also weighed on exports.
Exports to France declined 4.2% in May, exports to Germany dropped 6.0%, and exports to Japan fell 3.0%, while exports to Mexico were down 2.1%.
Imports from China climbed 9.5% in May.