By Ben Leubsdorf 

WASHINGTON--The U.S. trade gap narrowed in August as exports increased, a sign of stronger foreign demand for American-made goods that could help boost economic growth in the just-ended third quarter.

The trade deficit declined 0.5% to a seasonally adjusted $40.11 billion in August from the prior month's revised deficit of $40.32 billion, the Commerce Department said Friday. Economists surveyed by The Wall Street Journal had expected the trade deficit would widen in August to $41 billion.

Exports increased 0.2% from July to $198.46 billion, and imports rose 0.1% to $238.57 billion. Exports rose 4.1% in August from a year earlier, and imports rose 3.7% on the year.

A narrower trade gap can be a boon to economic growth if it signals stronger demand overseas for the goods and services produced by U.S. firms. An increase in exports provided a big boost to the economy in the second half of 2013, but foreign trade has been a drag on growth so far this year, according to Commerce Department estimates.

The third quarter ended Tuesday. The Commerce Department will release its first official estimate for gross domestic product, the broadest measure of output across the economy, on Oct. 30.

Some economists expect stronger growth based on the trade data, as well as September's robust job growth. Macroeconomic Advisers on Friday boosted its estimate for third-quarter GDP to growth at a 3.3% seasonally adjusted annual rate, up from 2.8%. Morgan Stanley boosted its estimate to growth at a 3.3% pace, up from 2.9%. Capital Economics projected 3.5% growth, with the stronger-than-expected trade data offsetting weaker-than-expected construction-spending data released Wednesday.

The U.S. trade deficit has been falling for four straight months. In August, exports of capital goods, consumer goods and industrial supplies and materials all rose, while exports of food and autos declined. Imports of capital and consumer goods rose from July, while auto imports fell.

U.S. imports from Germany hit a record in August, and U.S. exports to Japan were at their highest level since March 1996. Those figures weren't adjusted for seasonal variation.

In a testament to the domestic energy-production boom, U.S. petroleum exports were the highest on record in August and petroleum imports were the lowest seen since November 2010. The nation's seasonally adjusted petroleum trade deficit was at its lowest level since July 2004.

"If the recent trend continues, the U.S. will be a net oil exporter in just three years' time," Pantheon Macroeconomics chief economist Ian Shepherdson said in a note to clients.

One potential worry: The U.S. dollar has been rising for three months against a broad basket of world currencies. A stronger dollar makes U.S. goods more expensive overseas and could dent export growth. William Dudley, president of the Federal Reserve Bank of New York, warned last month that a sharp rise in the dollar could have "consequences for growth."

But that hasn't happened yet. "The August trade report shows the opposite -- despite the strengthening of the trade-weighted dollar this year, real exports have risen 10.9% at an annual rate over the last three months, while real imports have fallen 2.2%," RDQ Economics co-founders John Ryding and Conrad DeQuadros said in a note to clients.

Write to Ben Leubsdorf at ben.leubsdorf@wsj.com

Gap (NYSE:GPS)
Historical Stock Chart
From Mar 2024 to Apr 2024 Click Here for more Gap Charts.
Gap (NYSE:GPS)
Historical Stock Chart
From Apr 2023 to Apr 2024 Click Here for more Gap Charts.