Shipping containers destined for Europe sit on the cargo ship Baltimore as a passenger jet passes overhead at the Port of Boston, in Boston, Wednesday, Sept. 7, 2011. (Steven Senne/AP)

The U.S. trade deficit shrank in April, but only because a big drop in imports offset the first decline in U.S. exports in five months.

The Commerce Department said Friday that the trade deficit narrowed 4.9 percent in April to $50.1 billion.

U.S. exports, which had hit a record the previous month, fell 0.8 percent to $182.9 billion. Sales of everything from commercial jetliners to industrial machinery declined.

Imports, which also set a record in March, dropped an even greater 1.7 percent to $233 billion.

The trade gap remains wide and could weigh on growth in the April-June quarter. A wider trade gap slows growth because it means that the United States is spending more on foreign-made products than it is taking in from sales of U.S.-made goods.

The slip in exports is especially troublesome because it shows the weaker global economy is dampening demand for American-made goods. Export sales declined to Europe, China and Brazil.

“With growth in Asia cooling, Europe in recession and the U.S. dollar strengthening, exports are likely in for another rough ride over the next year,” said James Marple, senior economist at TD Economics.

U.S. exports to the 27-nation European Union dropped 11.1 percent in April. Europe’s debt crisis has worsened in recent months, and many economists say the region is already in recession. Europe accounts for almost one-fifth of U.S. exports.

Growth has also slowed in emerging market countries. Exports to Brazil fell 8.2 percent in April.

The U.S. deficit with China increased to $24.6 billion in April. This year’s deficit is running 11.9 percent ahead of last year, when the imbalance hit an all-time high of $295.4 billion. That’s the highest ever recorded for a single country.

So far this year, the trade deficit — the difference between imports and exports — is running at an annual rate of $603 billion, up 7.7 percent from last year’s total imbalance of $559.9 billion.

For April, the United States ran a $1.8 billion trade deficit with South Korea, three times the size of the March deficit. Imports from South Korea jumped 14.7 percent to $5.5 billion, the highest amount on record. U.S. exports to South Korea fell 12.3 percent to $3.7 billion.

The U.S. trade balance. (The Washington Post/Source: Commerce Department)

On April 15, the new U.S.-South Korea Free Trade Agreement took effect, lowering trade barriers between the two nations. It is the biggest free trade agreement reached by the United States since the North American Free Trade Agreement with Canada and Mexico in 1994.

— Associated Press