The U.S. economy grew far less than expected in the second quarter as inventories fell for the first time since 2011, but a surge in consumer spending pointed to underlying strength.

Gross domestic product increased at a 1.2 percent annual rate after rising by a downwardly revised 0.8 percent pace in the first quarter, the Commerce Department said on Friday. The economy was previously reported to have grown at a 1.1 percent pace in the first quarter.

Economists polled by Reuters had forecast GDP growth rising at a 2.6 percent rate in the last quarter.

While the drop in inventories weighed on GDP growth last quarter, that is likely to provide a boost to output for the rest of the year. The Federal Reserve said on Wednesday that near-term risks to the economic outlook had "diminished."

The government also published revisions to data going back to 2013 through the first quarter of 2016. The revisions partially addressed measurement issues, which have tended to lower first-quarter GDP estimates. GDP growth in the first quarter of 2015 was revised sharply higher to a 2.0 percent rate from the previously reported 0.6 percent pace.