U.S. economic growth accelerated in the second quarter, the Bureau of Economic Analysis reported Wednesday morning. Real gross domestic product grew at a 4 percent annual rate, beating analysts' expectations and marking a sharp swing back toward economic expansion after the first quarter's contraction.

The early months of the year were also less damaging for the economy than previously thought. The BEA reported in its recalculation of GDP that the economy shrank at a 2.1 percent clip in the first quarter, rather than the 2.9 percent previously estimated. That poor result defied other signs that commerce continued to expand during the beginning of the year, such as accelerating job growth and rising inflation.

The second quarter's strong mark was driven by rising personal spending and exports, as well as increases in state and local spending. Businesses adding inventories, however, accounted for 1.7 percentage points of the 4 percent increase. Inventories are not predictive of future growth. Final sales, which reflect demand, grew at a significantly lower 2.3 percent.

On the other hand, private investment also picked up, contributing 2.6 percentage points to growth, the strongest such mark since late 2011.

The BEA's advance estimate released Wednesday will be followed by two more estimates with more complete data and is subject to significant revisions.

Over the past four quarters, annualized GDP growth has averaged just under 2.5 percent, only slightly above the recovery average.

With the revisions announced by the BEA on Wednesday, the recovery appears to have been noticeably stronger through 2013 than previously thought. The growth rate for the year was marked up by a third of a percentage point to 2.2 percent, with the third quarter hitting 4.5 percent annual growth and the fourth quarter 3.5 percent.

Most economists expect the economy to continue to strengthen throughout 2014. Following Wednesday's numbers, the forecasting company High Frequency Economics predicted that growth in the next two quarters will come in at 3.3 percent.