A cargo ship docks in the Port of Miami.
NEW YORK (CNNMoney) -- The U.S. trade deficit widened in May to the largest level in more than 2-1/2 years, as exports slowed during an economic soft patch, and imports picked up along with higher oil prices.
The nation imported $50.2 billion more than it exported in May, up from a revised $43.6 billion trade deficit in April, the Commerce Department said Tuesday.
It marked the deepest trade deficit since October 2008 and came in above forecasts. Economists surveyed by Briefing.com were expecting the trade gap to widen to $44 billion.
In May, imports totaled $225.1 billion, up 2.6% from the month before, but exports fell 0.6% to $174.9 billion.
Since 1975, the U.S. has imported far more goods and services than it exports to other countries, marking multi-billion dollar trade deficits.
While that's not likely to change any time soon, economists like to see exports grow and the overall trade gap narrow, because a smaller deficit can add to the nation's gross domestic product.
President Obama is pushing for exports to double by the end of 2014 for exactly that reason, So far, he claims he's "on track."
For the first four months of the year, exports were up 16%.
That progress stalled in May, when the economy hit a soft patch and high oil prices continued to inflate import growth. The exports were still up 14% for the first five months of the year.
Overall, imports of industrial supplies and materials including oil, capital goods and automotive vehicles, parts and engines increased, while imports of consumer goods fell.
The oil effect: The biggest driver behind the import surge was by far, crude oil imports which climbed 15% in May due to higher oil prices.
At $108.70 a barrel in May, oil was at its most expensive level since August 2008, the Commerce Department reported.
Paul Dales, senior U.S. economist with Capital Economics, expects the oil effect to reverse itself nearly entirely in June, reflecting crude prices that have fallen recently.
Overall, he predicts the U.S. economy grew about 2% in the second quarter -- due almost entirely to foreign trade.
"On first reflection, today's release suggests that net trade may have added something like 2 percentage points to annualized GDP growth in the second quarter," he wrote in a research report. "Without this, the economy might have ground to a complete halt."
The Japan effect: Meanwhile, the trade impact of Japan's earthquake and tsunami in March has started to fade.
Japan remains the United States' fourth largest trading partner, even after U.S. imports from Japan plummeted 23% in April. In May, they rebounded 5.9%, with the U.S. importing $2.6 billion more than it exported from Japan.
|What we want Apple to unveil at WWDC|
|Millennials squeezed out of buying a home|
|7 traits the rich have in common|
|Big Data knows you're sick, tired and depressed|
|Your car is a giant computer - and it can be hacked|
|Overnight Avg Rate||Latest||Change||Last Week|
|30 yr fixed||3.98%||3.95%|
|15 yr fixed||3.05%||3.05%|
|30 yr refi||4.05%||4.03%|
|15 yr refi||3.12%||3.11%|
Today's featured rates:
|Latest Report||Next Update|
|Home prices||Aug 28|
|Consumer confidence||Aug 28|
|Manufacturing (ISM)||Sept 4|
|Inflation (CPI)||Sept 14|
|Retail sales||Sept 14|