Economists say the unexpected narrowing in the June trade deficit was helped by continued strength in the export market, which should give second-quarter GDP a boost when revisions are released later this month.

The Census Bureau's report said the trade deficit came in at $56.8 billion, compared to the -$62.0 billion balance expected by markets. In addition, May's deficit figure was upwardly revised to $59.2 billion from a previously reported -$59.8 billion.

Paul Ashworth, U.S. economist at Capital Economics, said the improvement "was driven by a massive $6 billion decline in the non-petroleum deficit, which more than offset the higher cost of imported oil."

He said the 4.0% advance in exports suggests weakness in Europe and Asia has yet to soften demand for American goods, while the 1.4% decline in non-oil imports reflect "the desperate weakness of domestic demand in the US."

Total June exports were $164.4 billion, while imports were $221.2 billion, resulting in a goods and services deficit of $56.8 billion. June exports were $6.4 billion more than May exports of $158.0 billion, and June imports were $3.9 billion more than May imports of $217.2 billion.

Millan Mulraine, economics strategist at TD Securities, noted the gain in exports was the biggest monthly advance since February 2004, which helped the non-petroleum trade balance narrow by a "massive" $6 billion.

Ashworth added that the report would likely push up second-quarter GDP results by a few tenths.

The goods deficit decreased $2.1 billion from May to $70.0 billion and the services surplus increased $0.4 billion to $13.3 billion. Exports of goods increased $5.7 billion to $116.7 billion and imports of goods increased $3.6 billion to $186.7 billion. Exports of services increased $0.7 billion to $47.7 billion and imports of services increased $0.3 billion to $34.5 billion.

Looking ahead, Ashworth said it will be hard to judge the future path of the trade deficit. "It should rebound over the next month or two thanks to the lagged impact of $140 a barrel oil, but if oil continues its downward spiral then that will begin to have a strong downward impact on the deficit over the second half of the year."

He added that a slowing global economy will eventually hurt U.S. exports as well. "All things considered, we suspect the deficit will continue to narrow, albeit more gradually.

By Patrick McGee and edited by Nancy Girgis