The US trade deficit with other nations surged 13.3 percent in July, partly reflecting higher oil prices and a rise in imports of autos and auto parts.

The trade gap widened to a seasonally adjusted $39.1 billion from a revised $34.5 billion in June, the Commerce Department said Wednesday.

Economists polled by MarketWatch had expected the deficit to climb back to $39 billion after an unusually sharp decline in the prior month. The trade gap sank more than 20 percent in June to the lowest level since the fall of 2009.

The value of goods imported into the US rose 1.6 percent to $228.6 billion. US imports of petroleum increased in July and demand for foreign-made autos and parts hit a record high.

Exports slipped 0.6 percent to $189.4 billion, as shipments of US-made commercial planes, industrial engines and finished jewelry declined.

Although the increase in imports suggests strengthening demand in the US, a larger trade gap usually means slower economic growth at home since America is buying more goods and services from other countries.

The wider gap in July could be another drag on US growth in the third quarter, which has gotten off to a slow start. Economists forecast gross domestic product to taper off to 2.1 percent from 2.5 percent in the second quarter.

Still, the US trade gap is down 10 percent from one year ago, largely because the nation is producing and refining more petroleum for export. American exports of petroleum products set another record in July at $12.5 billion, helped by a technology called fracking that has allowed drillers to extract oil previously inaccessible on US territory.

The trade deficits with China and the European Union, which are unadjusted, were the highest on record. The US has been selling more goods and services to South America, however, and exports to Brazil touched a record high. Marketwatch