Home sales in the Twin Cities metro area slumped last year, but with the economy on the mend and the foreclosure crisis nearing an end, house prices posted significant gains.

Throughout the region last year, there were 49,541 sales, down nearly 7 percent from the previous year but the second-highest figure since 2005, according to year-end data released Wednesday by the Minneapolis and St. Paul Area Associations of Realtors. The median price of those sales was $205,739, a 7.2 percent gain and the highest median price in seven years.

Though it was a disappointing year for many agents and their sellers, it was by nearly every measure the healthiest market since the housing crash in 2008. The foreclosure rate fell to near-normal levels, buyers were met with more options than in previous years and houses sold more quickly than they have in at least a decade.

"The market is returning to more solid footing," said Tom Weiner, president of the St. Paul Area Association of Realtors.

Much of the stability had nothing to do with buyers and sellers. By the end of 2014, the mortgage delinquency rate in the Twin Cities metro fell to just under 3 percent, according to CoreLogic. By another measure, during the first half of the year, there were 4,375 foreclosure sales across the state, a 36 percent decline from 2013 to near normal levels, according to the Minnesota Homeownership Center.

That shift has had a radical impact on the market. Only 16.5 percent of all sales last year were foreclosures or short sales, compared with 26.3 percent in 2012 and 39.7 percent the year before, leaving investors, and first-time buyers, with fewer options than in previous years.

Chris Willette, a sales agent with Edina Realty, said that at the peak of the crisis nearly every one of his deals was a short sale, which he expects will represent only 70 to 80 percent of his sales this year.

"The market last year was a grind, no real easy deals," he said, lamenting the lack of bargains.

As investors left the market, move-up buyers replaced them, creating a new wave of demand for houses like the tidy rambler that Matthew and Hannah Kull are buying in the Highland Park neighborhood. Like many of the move-up buyers in the Twin Cities, the Kulls are transplants. They moved from Kansas City, Kan., to the Twin Cities for work. Hannah Kull, a nurse practitioner, was recruited by a local firm. They lived in a rental house for a few months while trying to sell their house in Kansas. They, like a growing number of buyers last year, focused their house hunt on neighborhoods where they could walk to shops, restaurants and parks.

"We didn't want to settle for suburbia," said Matthew, a firefighter.

Their initial budget was $200,000 to $220,000, but it was difficult to find a house in that price range that didn't need a lot of work. With a 16-month-old daughter, Hazel, they wanted a house that was move-in ready. After looking at more than 20 houses, they found exactly what they wanted in Highland Park. Within two hours of seeing the house, less than three days after it hit the market, they made a full-price offer.

"Time is the only thing that we didn't have on our side," Matthew Kull said. "We just got really lucky."

With higher prices and fewer homeowners underwater on their mortgages, home buyers were in a much better position than they had been in previous years as sellers stepped forward. Last year, there were 73,768 house listings, a 2.3 percent increase from 2013 and the most choices for buyers since 2010.

Though the housing market made strides last year, challenges remain. Many buyers still haven't regained confidence in the market, and are leery of overpaying for a house, putting sellers on edge.

And an emerging wave of millennial buyers have dramatically different needs than many of their baby boomer predecessors, who are getting ready to unload their big houses in the suburbs.

"I would say there's a fair bit of optimism out there, but the market is unpredictable," said Bruce Erickson, a sales agent with Coldwell Banker Burnet. "It's been a bit harder to really know if buyers, or sellers, are in charge."

Jim Buchta • 612-673-7376