GDP grew at rate of 4 percent in the spring, providing fresh evidence that the recovery is finally turning a corner. (Ricky Carioti/The Washington Post)

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 during 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.

The decline “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. “A stronger-than-expected bounce back should assuage fears that it is anything but a one-off event.”

President Obama celebrated the country’s economic progress in a speech in Kansas City, Mo., 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.

“There are a lot of good reasons to be optimistic about America,” he said. “Things are getting better. Decisions we make now can make things even better than that.”

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 the good news was that 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.

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 at 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.”

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 0.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 in the recovery, 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.

In Kansas City, Obama tried to balance the brightening outlook for the broader economy with recognition that the uneven recovery has passed by many ­middle- and low-income households. The White House is pushing efforts to address that divide, including raising the minimum wage and closing corporate tax loopholes. But few, if any, of those initiatives are likely to gain traction in Congress, especially ahead of midterm elections in the fall.

“That’s the measure of whether the economy is working — not just how well it’s doing overall, but is it doing well for ordinary folks who are working hard every single day and aren’t always getting a fair shot?” Obama said.

That can be a tricky message to convey, both to voters and to Wall Street. The Federal Reserve issued a carefully worded statement Wednesday after its two-day policy meeting in Washington that also 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. But the Fed also said that many people are underemployed, such as the millions of workers in part-time jobs who would prefer more hours.

“There remains significant under­utilization of labor resources,” the statement read.

At the same time, 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. Rising inflation means the job market is closer to healing and the recovery is gaining momentum. The Fed’s long-run target for price increases is 2 percent.

“The likelihood of inflation running persistently below 2 percent has diminished somewhat,” the central bank said in its statement.

The Fed has pumped trillions of dollars into the economy since the recession and is slowly starting to scale back its support for the recovery. Officials voted to pare back the amount of long-term bonds the Fed is purchasing to $25 billion a month. That program is expected to end in October, but the central bank gave no hint of when it might raise its benchmark short-term rate.

Investors seemed unsure how to digest the Fed’s assessment. The blue-chip Dow Jones industrial average and the broader Standard & Poor’s 500-stock index wobbled after the statement was released Wednesday afternoon. Both indexes initially climbed but gave back those gains in last-minute trading. The S&P ended virtually flat, while the Dow closed down about 0.2 percent. The tech-heavy Nasdaq stayed in positive territory all day, ending up about half a percent.