After suffering the sharpest contraction since the recession ended, the U.S. economy rebounded this spring, growing at a solid 4 percent annual rate, according to new government data released Wednesday.

Robust consumer spending helped drive the expansion during the second quarter, while businesses rebuilt their inventories. U.S. exports spiked, helping to offset a jump in imports. State and local governments also increased their spending after cutting back during the first quarter. The growth rate beat analysts’ expectations and helped bolster hopes that the country’s long-simmering economic recovery is becoming self-sustaining.

Many economists have written off the decline in growth during the first quarter as an anomaly caused by brutally cold weather and poor accounting of the impact of the Affordable Care Act. New revisions to government data show the economy shrank at an annual rate of 2.1 percent in the first quarter.

"The decline in first-quarter GDP is still a bit of a mystery and at odds with the improvement in the labor market," said James Marple, senior economist at TD Economics. "Still, a now-smaller decline and a stronger-than-expected bounce back should assuage fears that it is anything but a one-off event."

The government's data revisions mean that the early years of the recovery were not as robust as previously thought, but also that momentum has built more rapidly. Annual growth in 2011 and 2012 was lower than had been reported, but the recovery picked up more steam in 2013. The government said Wednesday the economy grew 2.2 percent last year, up from its previous estimate of  1.9 percent.

Other measures point to the growing strength of the recovery, as well. A private estimate of monthly job growth by human resources firm ADP released Wednesday morning showed 218,000 net new positions were created in July -- slightly fewer than anticipated but still a healthy showing. Mark Zandi, chief economist of Moody's Analytics, which helped calculate the data, said he expects the country to reach full employment by late 2016.

"At the current pace of job growth, unemployment will quickly decline," he said. "Layoffs are still receding, and hiring and job openings are picking up."

Government data show the number of people filing for unemployment benefits for the first time fell to its lowest level in eight years last week. A closely watched survey by The Conference Board showed consumers expressed more confidence in the economy in June than they have at any point since the recession began in late 2007.

Much of that optimism is due to the pickup in hiring. The economy has added an average of about 230,000 jobs a month so far this year, and analysts expect to hit that mark again when the government releases its monthly update on the labor market Friday.

“Recent improvements in consumer confidence, in particular expectations, suggest the recent strengthening in growth is likely to continue into the second half of this year,” said Lynn Franco, director of economic indicators at The Conference Board.

Wall Street also seemed more confident on Wednesday. The major indexes opened strongly positive, with the tech-heavy Nasdaq up nearly 0.7 percent. The robust U.S. data seemed to overshadow ongoing tensions in the Middle East and the new sanctions on Russia over the conflict in Ukraine.

The government data released Wednesday showed consumer spending rose 2.5 percent in the second quarter, compared to the more anemic 1.2 percent bump over the winter. Big-ticket auto purchases drove those gains, but consumers also shelled out for other durable goods such as furniture. Health care spending, previously seen as an economic boost, contributed a meager .08 percentage points to the country's growth rate.

After consumer spending, businesses stockpiling inventory was the other main factor in the second quarter expansion. It added 1.7 percentage points to increase in gross domestic product, after dragging down GDP by a percentage point over the winter.

Even real estate, which has remained a sore spot in the recovery, enjoyed an upturn during the second quarter. Real residential fixed investment rose 7.5 percent after shrinking over the winter. Still, data released this week showed that sales of new homes plummeted 8 percent in June, and the recent rise in home prices has slowed sharply.

The Federal Reserve has pointed to the housing market as an area of concern, with Fed chief Janet Yellen calling the sector’s performance “disappointing” during testimony on Capitol Hill earlier this month. The Fed will conclude its regular policy session in Washington on Wednesday afternoon. The rate of growth during the second quarter is unlikely to change its strategy of scaling back the amount of money it is pumping into the economy by $10 billion each meeting.

Lindsey Piegza, chief economist at Sterne Agee, said she sees little indication that the economy can replicate the pickup in the second quarter in the upcoming months. She expects growth to moderate to a roughly 2 percent pace during the second half of the year.

"It certainly has little impact from the Fed's standpoint," she said.

While Yellen has acknowledged the recovery’s progress, she also has repeatedly emphasized that it remains far from complete. The Fed is expected to announce the outcome of its meeting at 2 p.m.