The trade deficit in the U.S. narrowed slightly in May as exports to Europe and China rose, while import bill fell on cheaper crude oil prices.

The gap shrank 3.8 percent to $48.7 billion, in line with consensus expectations, from $50.6 billion in April, the Commerce Department reported Wednesday.

Imports dropped 0.7 percent to $231.8 billion, the fewest since February, from $233.3 billion the prior month. Demand for crude oil declined by $2.82 billion in May.

Exports increased 0.2 percent to $183.1 billion, supported by sales of food and capital equipment. U.S. exports to the 27-nation European Union rose 2.6 percent in May to $22.9 billion, while exports to China rose 5.2 percent.