The data came one day after the Federal Reserve ended its asset purchasing program. Fed officials said there was sufficient underlying strength in the broader economy.
The narrower trade deficit reflected a plunge in imports, which fell at their fastest pace since the fourth quarter of 2012. That was largely attributed to a drop in oil imports.
Trade added 1.32 percentage points to growth. Although there are concerns a strengthening dollar and slowing euro zone and Chinese economies will crimp U.S. export growth, economists believe the impact will be marginal.
Government spending was also a boost, with defense spending rising at its fastest pace since the second quarter of 2009.
One of the few areas that was a drag on growth was inventories, which subtracted 0.57 percentage point from GDP after adding 1.42 percentage points in the second quarter.
Growth in business investment slowed in the third quarter, with spending on equipment rising at only a 7.2 percent rate. Economists had expected a second straight quarter of double-digit growth.
Business spending on structures and intellectual products also slowed. Data on Tuesday suggested further moderation in the pace of equipment investment in the fourth quarter, but it is still expected to remain strong enough to keep the economy on a higher growth pace.
While growth in consumer spending decelerated to a 1.8 percent pace from the second-quarter's 2.5 percent pace, it still contributed 1.22 percentage points to GDP growth.
Consumer spending accounts for more than two-thirds of U.S. economic activity.
Read MoreMarket pro: Leave Janet Yellen alone!
The moderate pace of consumer spending helped keep inflation pressures under wraps during the quarter, with the two price indexes in the report decelerating sharply.
Declining gasoline prices and accelerating job growth, which is expected to lift wages, will provide tailwinds for consumer spending in the fourth quarter.