The U.S. economy performed better in the second quarter than earlier estimated, growing at a strong 3.9 percent annual rate, the Commerce Department said Friday.

The new data showed economic growth rebounded sharply from weak 0.6 percent annualized growth in the first quarter, fueled by increases in consumer spending, exports, business investment and government expenditures.

The third and final report on total economic output for the April-though-June period was up 0.2 percentage points from last month’s estimate. Analysts had expected no upward revision.

Consumer spending was stronger than initially thought, increasing at a 3.6 percent annualized rate compared with last month’s estimate of 3.1 percent. Consumer spending grew just 1.8 percent in the first quarter.

“The consumer really had a good head of steam in the second quarter,” said Chris Rupkey, chief financial economist at Union Bank in New York. “This is important and is likely to give the economy some backbone going into the financial markets turmoil and stock market gyrations in August.”

Much of the second-quarter growth was the U.S. catching up after a slow start to the year.

Economic expansion is expected to slow in the third quarter as the U.S. deals with slowing economies, particularly in China.

The Federal Reserve Bank of Atlanta projects the economy grew at just a 1.4 percent annualized rate from July through September.