The U.S. economy slowed in the third quarter but growth continued thanks to strong consumer spending offsetting the drag of flagging business investment, uneven trade policy, and low levels of demand for U.S. exports from sluggish economies around the globe.

Gross domestic product, a broad measure of goods and services produced across the economy, rose at a 1.9 annual rate in the third quarter, adjusted for seasonality and inflation, the Commerce Department said Wednesday. That is down only slightly from 2 percent pace in the second quarter and a 3.1 percent pace in the first quarter.

Economists had expected growth to slow by even more, to an annualized rate of 1.6 percent.

Inflation-adjusted consumer spending rose 2.9 percent, above the forecast for 2.6 percent. That’s all the more remarkable because the second quarter recorded 4.6 percent growth in consumer spending. Such back-to-back strength is unusual. Durable goods spending grew at a 7.6 percent rate on the back of last quarter’s 13 percent growth rate.

Residential investment rose at a 5.1 percent annual rate, making housing a significant contributor to economic growth in the quarter. Spending on vehicles was strong as was recreational spending, which along with housing is a sign of robust consumer confidence.

Business investment was weak. Nonresidential fixed investment, inventories, and equipment were all drags on growth for the quarter.

Inflation was muted, with the GDP price personal consumption price expenditure index rising at a 1.7 percent rate, below the 2.4 percent rate in the second quarter. So-called “core” inflation, which excludes volatile food and energy prices, was up 2.2 percent.