WASHINGTON (AP) — The U.S. housing market is finally on the mend after its most far-reaching collapse in 70 years. That could help rebuild consumer confidence and revive the economy.

For the first time in five years, sales of previously occupied homes rose for the third consecutive month in June, while foreclosure sales and the glut of homes on the market both declined.

The figures, released Thursday by the National Association of Realtors, and a string of rosy corporate earnings reports sparked a rally on Wall Street as the Dow Jones industrials rose above 9,000 for the first time since January.

“People believe that the worst is behind us,” said Julie Longtin, a real estate agent with Re/Max Professionals in Providence, R.I., an area that has suffered deeply from record foreclosures of risky loans.

It was the first time in five years that home resales improved for three consecutive months, the association said. What’s more, foreclosure-related sales and the glut of homes on the market both declined.

Sales also have risen for three straight months in 40 out of 55 major metropolitan areas tracked by the Associated Press-Re/Max Housing Report, also released Thursday. Prices rose during that period in about half of those areas.

Still, unlike past recessions, the turnaround in the real estate sector is likely to have a muted effect overall. That’s largely because homebuilders are expected to keep bulldozers idle as long as they face competition from bargain-priced foreclosures. And it’s likely to take at least another year before job losses and foreclosures peak.

The Labor Department said Thursday the number of newly laid-off workers seeking jobless benefits rose 30,000 to a seasonally adjusted 554,000 last week, though the government said its report again was distorted by the timing of auto plant shutdowns.

Unemployment insurance claims have declined steadily since the spring, but most private economists and the Federal Reserve expect jobs to remain scarce and the unemployment rate to top 10 percent by year-end.

“We’re not going to see much growth in (home) sales until the labor market turns around,” said Patrick Newport, an economist with IHS Global Insight. “People don’t move as much when they can’t find work.”

But companies should start hiring as their fortunes improve – and there were some early signs Thursday that’s starting to happen.

Ford Motor Co. surprised investors with a profit of $2.3 billion, due mainly to a huge gain for debt reduction, while manufacturing conglomerate 3M Co. and candy maker Hershey Co. raised their profit forecasts for the year.

The stock market’s best-known indicator shot up almost 190 points Thursday to 9,069.29, its highest level since November, and all the big indexes gained more than 2 percent.

Analysts said signs that housing market is finally, gradually turning around could help spur demand as buyers become less fearful of losing their shirts.

“It’s been the abject pessimism about house prices that has placed a pall over the housing market,” said Mark Zandi, chief economist at Moody’s Economy.com. “As that psychology reverses itself, things start to work in the opposite direction.”

Home sales rose 3.6 percent to a seasonally adjusted annual rate of 4.89 million last month, from a downwardly revised pace of 4.72 million in May. Sales are now around the same level as before last fall’s financial crisis.

Foreclosures, however, continue to put pressure on home prices. About one out of three homes sold in June was foreclosure-related, down from nearly half earlier this year.

And despite some buyers’ optimism, some still see potential problems ahead. A tax credit of up to $8,000 for first-time homebuyers expires Nov. 30. Mortgage rates are up from record lows reached last spring, and companies are still shedding jobs.

The nationwide median sales price was $181,800 in June, down 15 percent from year-ago levels but up slightly from $174,700 in May. And an Associated Press analysis shows the shows that the gap is narrowing between the sellers’ asking price and the final sales price, indicating homeowners have finally accepted that their homes are worth far less today.

Jim Dugan, a 53-year-old plumber, is looking for foreclosures and other low-priced properties in Providence. He wants to buy eight investment properties this year and is slated to close on a small bungalow next week for $62,500.

The property was originally listed for $85,000. But Dugan was able to snare a deal because he didn’t need a mortgage, instead tapping a line of credit and his savings.

“Cash talks,” he said.

Investor activity is helping to pare the number of homes on the market. Nationwide there are about 3.8 million, or a 9.4-month supply at the current sales pace. When the market balances at a 7-month supply, prices should begin to stabilize.

A healthy housing market is characterized by prices that rise a relatively modest 4 to 5 percent every year. But this year’s sales prices are still far lower than last year.

Those low prices combined with mortgage rates around 5 percent and a tax credit for first-time homebuyers have made homeownership more affordable than it’s been in decades.

“We are seeing contracts like crazy,” said Valerie Huffman, a vice president of Weichert Realtors, in Montgomery County, Md., where home sales are up by 42 percent over last year. “We’re having multiple bids on anything that’s priced well.”

Only subscribers are eligible to post comments. Please subscribe or to participate in the conversation. Here’s why.

Use the form below to reset your password. When you've submitted your account email, we will send an email with a reset code.