The US trade deficit narrowed more than expected in June as petroleum imports dropped to a 3-1/2-year low, suggesting that trade was less of a drag on second-quarter economic growth than initially thought.

The country’s Commerce Department said the trade gap shrank 7% to $41.5bn, the lowest reading since January. 

That was smaller than the roughly $44.8bn shortfall the government had assumed in its first snapshot of second-quarter gross domestic product published last week.

"The improvement in June could mean a modest upward revision to the second-quarter GDP estimate," said Millan Mulraine, deputy chief economist at TD Securities in New York. 

"It also implies a fairly strong hand-off to third-quarter GDP."

When adjusted for inflation, the deficit narrowed to $48.8bn from $52bn in May. 

As a result, economists expect the GDP growth estimate for the April-June quarter to be raised by as much as 0.3 percentage point later this month.

The government estimated a week ago that trade subtracted 0.61 percentage point from growth in the April-June period. 

In that report, it said the economy expanded at a 4% annual rate during that quarter after shrinking 2.1% in the first three months of the year.

Economists had expected a trade gap of $44.7bn in June, a slight widening from the previously reported $44.4bn May shortfall. 

The May gap was revised to $44.7bn.

Imports fell 1.2% in June, the largest drop in a year, to $237.4bn. That came as petroleum imports declined to $27.4bn, the lowest level since November 2010, from $28.3bn in May.

A domestic energy boom has seen the country reduce its dependence of foreign oil. In June, the petroleum deficit fell to its lowest level since May 2009.

Non-petroleum imports were also weak, falling to $167.6bn from $169.6bn in May, suggesting a slower pace of inventory accumulation by businesses that month.

They were dragged down by declines in industrial supplies, capital goods, autos and consumer goods. 

Food imports, however, hit a record high. The decline in imports is at odds with strong manufacturing activity and relatively firm domestic demand.

"With the economy growing, consumer and business spending rising and vehicle sales robust, there is every reason to believe that imports will rebound going forward," said Joel Naroff, chief economist at Naroff Economic Advisors in Holland, Pennsylvania.

Ted Wieseman, an economist at Morgan Stanley in New York, said anecdotal reports pointed to some significant front-loading of imports through the West Coast in July ahead of a feared dockworkers strike, which was avoided.

Exports edged up 0.1% to a record high of $195.9bn in June, supported by a surge in automobiles, parts and engines, which rose to an all-time high.

Consumer goods exports also hit a record high. There was also a jump in crude oil exports.

"We still see net exports on pace to contribute to third-quarter GDP," said Wieseman. Third-quarter growth estimates are currently around a 3% pace.

Exports to Canada hit an all-time high in June.

Exports to China rose 1.4%, while imports from that country increased 3.7%.

That left the politically sensitive trade gap with China at $30.1bn, up 4.5% from May.