WASHINGTON — After suffering the sharpest contraction since the recession ended, the U.S. economy rebounded this spring, providing fresh evidence that the recovery is finally turning a corner.

Government data released Wednesday shows the economy expanded at an annual rate of 4 percent in the second quarter. Consumers pulled out their wallets, businesses restocked their inventories, and even the long-moribund housing market perked up.

The strong report dovetails with recent improvements in the job market. The Labor Department is expected to announce Friday that more than 200,000 net new jobs were created in July, marking the sixth straight month it has hit that benchmark.

For many economists, that leaves the dismal winter – and its 2 percent drop in growth – firmly in the rearview mirror.

President Obama celebrated the country’s economic progress in a speech in Kansas City, Missouri, on Wednesday. He said industries such as construction, manufacturing, technology and automobiles are “booming” and that Americans have “dusted ourselves off” since the darkest days of the financial crisis.

Revised government data released Wednesday revealed that the early years of the recovery were not as robust as previously thought. Annual growth in 2011 and 2012 was lower than had been reported, but momentum picked up more quickly in 2013. Instead of growing just 1.9 percent last year, the economy expanded 2.2 percent.

The first few months of this year also look better in retrospect. The data now shows the economy shrank at about a 2 percent annual rate, not the more dire 3 percent previously estimated.

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 at Moody’s Analytics, which helped calculate the data, said he expects the country to reach full employment by late 2016.

Driving the economy during the second quarter was a 2.5 percent jump in consumer spending, outpacing the 1.2 percent increase over the winter. Big-ticket auto purchases boosted those gains, but consumers also shelled out for other durable goods such as furniture. Health-care spending, previously seen as an significant catalyst for growth because of the rollout of the federal Affordable Care Act, contributed a meager .08 percentage points to the country’s economic expansion.

After consumer spending, businesses’ stockpiling of inventory was the other main factor in the second-quarter expansion. It added 1.7 percentage points to the 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, experienced 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 issued a carefully worded statement Wednesday after its two-day policy meeting in Washington that attempted to bridge the gap.

The nation’s central bank pointed out that the unemployment rate is falling and abandoned its previous caveat that the number remains elevated, now that it has fallen to 6.1 percent, the lowest level since 2008. Still, the Fed pointed out that many people are underemployed, such as the millions of workers in part-time jobs who would prefer more hours.

The Fed acknowledged that inflation is beginning to pick up. For much of last year, officials had worried that prices were too low, signaling the economy was still weak. The Fed’s long-run target for price increases is 2 percent.

It gave no hint of when it might raise its benchmark short-term rate.