The U.S. trade deficit narrowed by $7 billion in July to $42.8 billion as exports rose to nearly a two-year high, the Commerce Department reported Thursday. It was the first trade-deficit reduction in four months.

Economists expected a $47 billion trade deficit in July, according to the median estimate from Thomson Reuters.

July exports of goods and services rose $2.8 billion to $153.3 billion, the largest amount since August 2008. U.S. imports contracted $4.2 billion in July to $196.1 billion. The June trade deficit was revised downward to $49.8 billion from $49.9 billion and is the largest since October 2008.

Exports of capital goods rose to $38.8 billion and non-petroleum exports increased to $100.9 billion to post their largest gains since August and September 2008 respectively. The value of crude oil imports fell as the average price tumbled to a nine-month-low of $72.09 per barrel.

According to gross domestic product figures released last month, the trade deficit between imports and exports widened to $536 billion in the second quarter. Imports subtracted 4.45 percentage points from GDP growth, the most since at least 1947.

July imports from China totaled $33.3 billion, the highest level since October 2008. But the trade deficit with China narrowed to $25.9 billion.

Diane Swonk, chief economist at Mesirow Financial, indicated that trade with China played a key role in the July trade deficit as “a stockpiling of goods from China abated over the course of the month” after the July 15 expiration of a subsidy on exports from the world’s most populous nation.

Subscribe Now

Independent and authoritative analysis and perspective for the bond buying industry.

14-Day Free Trial

No credit card required. Complete access to articles, breaking news and industry data.