The U.S. trade deficit for June shrank to the lowest level since October 2009, as crude oil imports declined while exports hit a record high. The unexpectedly severe narrowing suggests that second quarter gross domestic product growth was significantly stronger than the first estimate of a 1.7 percent annualised gain. The GDP figure will be revised at the end of the month.

The trade deficit, which measures how much more Americans buy from foreigners compared to how much they sell foreigners, contracted 22.4 percent to $34.2 billion from a revised $44.1 billion in May that was smaller than previously estimated, the Commerce Department said Tuesday. The percentage decline was the largest since February 2009.

Economists polled by Thomson Reuters had expected the trade deficit to shrink only to $43.5 billion in June.

The sharp narrowing of the trade gap reflected higher exports and lower imports. Exports of goods and services increased 2.2 percent to a record high of $191.2 billion. The trade gap with China narrowed to $26.6 billion from $27.9 billion, while the trade deficit with the European Union, Canada and Mexico also shrank.

Imports declined by 2.5 percent in June to $225.4 billion -- a three-month low -- as demand for overseas consumer goods and petroleum fell.

The three-month moving average of the trade deficit, which is a less volatile gauge, fell to $39.5 billion in the three months to June from $40.5 billion in the prior period.

"It looks like the U.S. economy ended the second quarter with a bit more positive momentum than we thought," Paul Ashworth, chief U.S. economist at Capital Economics, said in a note to clients. "Second-quarter GDP growth will be revised up to over 2 percent annualised and, unless this contraction in the deficit is fully reversed in July, third-quarter GDP growth is on track to hit 2 percent again."