The U.S. trade gap narrowed unexpectedly in August as oil imports plunged and exports grew for the fourth consecutive month, a U.S. Commerce Department report showed on Friday.

The deficit was $30.7 billion, down 3.6 percent from July, surprising analysts who expected higher oil prices and business stock rebuilding to widen the gap in August.

Average oil import prices rose for the sixth consecutive month to $64.75 per barrel. But petroleum imports fell more than 10 percent in volume, cutting the oil import bill.

Inventories of petroleum products have been running high, so cutting oil imports helps bring them down, said Nigel Gault, chief economist at IHS Global Insight.

As the United States climbs out of a recession that began in December 2007, analysts expect imports to grow faster than exports, which would make trade a drag on economic growth.

But in August, the situation was the reverse as goods and services imports fell 0.6 percent to $158.9 billion and exports grew 0.2 percent to $128.2 billion.

Markets mostly shrugged off the report, which showed trade hitting a plateau in August after partly recovering from a sharp plunge that began in mid-2008.

This is temporary payback from the strong numbers in July, said Zach Pandl, economist at Nomura Securities International in New York. The bottom line is that the trade picture from the United States is cloudy right now.

During the first half of 2009, trade was one of the few positive contributors to U.S. economic growth because imports fell more steeply than exports.

In the third quarter, trade is likely to be a drag on GDP growth of about 0.4 percentage point, with imports up more than exports, but GDP growth should still come in at just above 3.5 percent, Gault said.

Despite the overall import drop, imports from China and Mexico were the highest since November and those from Canada were the highest since December.

Imports of autos and auto parts also were the highest since late 2008, in a sign of demand generated by the federal government's cash for clunkers incentive program for autos.

Exports of services, led by an increase in travel and freight and port services, grew slightly in August, while goods exports fell.

Capital goods exports were the lowest since October 2005, reflecting a large drop in civilian aircraft shipments.

Some other categories such as industrial supplies and materials, autos and auto parts and petroleum products posted gains during the month.