The US trade deficit increased in April by 2.5% to $63.4bn (£35.4bn), as oil prices surged to nearly $71 per barrel.
US had a $17bn deficit with China
The figure was below that expected by analysts, who had feared that the deficit could soon reach $65bn.
The trade gap was $252bn for the year to date, leaving it on course to exceed the record $716bn recorded in 2005.
The high US trade deficit is leading to pressure on the US dollar, which has been falling in international markets, amid worries about financing the gap.
Analysts said that the April figure may help ease some of the negative feeling that has surrounded the dollar in recent months, even if only for a short time.
"It's a pretty good number for the dollar all around," said Clyde Wardle of HSBC.
The dollar gained against the euro and the yen on Friday after the US Commerce Department released its trade figures.
Most of the trade deficit's widening can be put down to an $1.44bn increase in oil costs after crude prices climbed to record levels in April.
The trade gap would have been even bigger but for near-record US exports to China and Canada.
But, the US also imported more goods from China, leading to an increased deficit of $17bn with that country alone.
US service exports - including things like travel, banking, and professional services - also surged to a new record.
US companies hope a weaker dollar will put some bite into exports
"The trade deficit, along with higher gasoline prices and the flagging housing sector, will slow GDP growth in the second and third quarters," said Peter Morici, trade economist at the University of Maryland.
"All of this makes more difficult the challenges faced by Fed Chairman Ben Bernanke."
Earlier this week, Mr Bernanke said that the central bank was worried about the rate of inflation, prompting a global sell-off in equities as investors worried that interest rates would have to rise to keep a lid on price growth.
A separate report from the Labor Department on Friday showed that import prices rose by 1.6% in May, fanning inflation fears further.
"When you are in a period of inflation phobia, this is not good news," said Keith Hembre, chief economist with FAF Advisors in Minneapolis.