U.S. economic growth slowed in the second quarter by less than forecast as consumer spending topped estimates, though weaker business investment and exports underscored the risks spurring the Federal Reserve toward an interest-rate cut next week.

Gross domestic product expanded at a 2.1% annualized rate, according to Commerce Department data Friday, July 26, that topped forecasts for 1.8%. That follows an unrevised 3.1% advance in first quarter and updated data showing growth last year was slower than previously reported.

Consumer spending, the biggest part of the economy, increased 4.3%, while government spending climbed 5% and offered the biggest boost in a decade. Nonresidential investment fell 0.6% for the first drop since 2015 and residential decreased for a sixth straight period.

"We have pockets of weakness in manufacturing, business investment, but as the consumer goes, so does the U.S. economy -- the fundamentals for the consumer are very, very good," said Ryan Sweet, an economist at Moody's Analytics Inc. "Unless the consumer starts to hunker it in, I think the U.S. economy is going to get through this little soft patch without it turning into something worse."

President Donald Trump tweeted his approval with another shot at the central bank for keeping monetary policy too tight for his liking. "Not bad considering we have the very heavy weight of the Federal Reserve anchor wrapped around our neck," he said.

TWEET: Donald Trump 07/26/19

The mixed report highlights how Trump -- who's repeatedly called for lower interest rates -- is enjoying signs of a solid economy while his trade war with China weighs on the expansion and fuels uncertainty for global businesses. Revised data released Friday showed the economy missed Trump's 3% growth goal in 2018, after previous data had showed it matching.

The report on the broadest measure of all goods and services comes as Fed is expected to cut interest rates next week by a quarter point. The GDP report isn't likely to sway that outcome, though officials are likely to consider the weakness in trade and corporate investment as risks to the economic outlook.

RELATED:

Friday's report showed fresh evidence that trade is weighing on the expansion as exports dropped 5.2% while imports rose just 0.1%. Overall growth on a year-over-year basis slowed to 2.3%, the weakest pace in two years.

"While growth slowed relative to the first quarter, this is not necessarily negative news, given that its composition is more sustainable," Bloomberg economists Carl Riccadonna and Eliza Winger said.

Excluding the volatile trade and inventories components of GDP, final sales to domestic purchasers increased at a 3.5% pace, the best in a year. Economists monitor this measure for a better sense of underlying demand. Inventories were a drag on growth, subtracting 0.86 point from growth after a 0.53 point contribution in the prior period.

The Fed's preferred underlying inflation measure, the personal consumption expenditures price index excluding food and energy, firmed to a 1.8% annual pace in the quarter, closer to policy makers' 2% objective.

Jul.26 -- Jim Caron, portfolio manager at Morgan Stanley Investment Management, Emily Roland, co-chief investment strategist at John Hancock Investment Management, and Jonathan Golub, chief U.S. equity strategist at Credit Suisse, examine second-quarter U.S. economic growth. They speak with Bloomberg's Jonathan Ferro on "Bloomberg Markets: The Open."

The expansion, which this month became the longest on record, is cooling as the effects of the 2018 fiscal stimulus fade and global growth slows, with the International Monetary Fund again cutting its estimate earlier this week. A stronger dollar and new tariffs are also making it less desirable to do business with the U.S.

Other data have highlighted the cooler pace of growth, with manufacturing figures showing tepid conditions and bellwether Caterpillar reporting a lackluster second quarter. A U.S. measure of production has declined in consecutive quarters, the common definition of recession, while a gauge of global factory activity contracted in May and June.

A more upbeat report Thursday showed business-equipment orders jumped in June by the most since early 2018, signaling company investment may be regaining momentum that would help support the economy in coming months.

Consumer sentiment is near historical highs and robust spending is backstopping growth. Retail sales have advanced for four straight months, the longest streak since early 2018, indicating Americans are benefiting from a tight labor market and elevated wages. Coffee chain Starbucks on Thursday said U.S. comparable-store sales soared 7% from a year earlier.

"This report shows we are not seeing shocks to the U.S. consumer," Denise Chisholm, a strategist at Fidelity Management, said in a Bloomberg Television interview. "It's positive from the framework of, we may see a prolonged expansion cycle continue."

Trump targets growth of about 3%, though economists see the pace of growth remaining under 2% through at least the end of next year. Revised GDP figures released Friday show 2.5% growth on a fourth-quarter-to-fourth-quarter basis last year. That compares with a previous estimate of 3% and an upwardly revised 2.8% in 2017, the first year of Trump's presidency.

Government spending got a boost from a 15.9% surge in federal nondefense expenditures, which contributed the most in two decades to growth. That was boosted by delayed compensation for some federal employees after the government shutdown that ended in January.

This article was written by Katia Dmitrieva, a reporter for Bloomberg. Bloomberg's Kristy Scheuble, Sophie Caronello, Reade Pickert and Ryan Haar contributed.