NEW YORK (CNNfn) - The U.S. trade deficit narrowed in July, the government said Wednesday, as both imports and exports were hurt by a slowdown in the world's largest economy.

The nation's trade gap shrank to $28.83 billion from a revised $29.07 billion in June, the Commerce Department reported. Economists polled by Briefing.com had expected the deficit to swell to $29.6 billion.

"Because the U.S. economy has slowed more sharply than the international economy, imports have been impacted more than exports, thereby narrowing the trade deficit," said Steven Wood, economist with FinancialOxygen.

Exports totaled $83.7 billion, down from $85.9 billion in June. Exports of industrial materials and supplies and automobiles and parts showed sizable declines.

Reflecting the U.S. economic slowdown, overall imports dropped for the fourth consecutive month in July to $112.6 billion, the lowest level since $111.4 billion in January of last year.

Though the report probably has little consequence in light of the Sept. 11 terrorist attacks on New York and Washington that completely changed the economic picture, it shows the economy was at risk for a downturn even before the attacks.

U.S. stocks fell as investors worried about the outlook for corporate profits, while Treasury bond prices were slightly higher.

The Federal Reserve has cut its target for short-term interest rates eight times this year in an effort to avert a recession. The eighth cut was made Monday, mostly in an effort to let consumers and stock traders know it was ready to pump as much money into the economy as necessary after the attacks.

Many economists think the aftershocks of those attacks could tip the economy, which already was shaky after a year-long slowdown in business spending and manufacturing that led to hundreds of thousands of job cuts, into a recession.

Although the overall deficit declined slightly, the trade gap with Western Europe hit a record $8.6 billion as U.S. exports to the region dipped to $12.3 billion, the lowest since July 1999.

U.S. exports to Japan fell to $4.32 billion, the lowest level since May 1999. The deficit with Japan widened to $5.9 billion, from $5.0 billion in June.

Both U.S. imports from China and the U.S. trade deficit with China hit their highest levels since November of last year. Imports totaled $9.0 billion, pushing the monthly bilateral trade gap to $7.5 billion. - from staff and wire reports