It was the best July in years for the Twin Cities housing market, with healthy gains in prices, closings and pending sales.

New data from the Minneapolis Area Association of Realtors (MAAR) showed closings up 14.6 percent over last year and pending sales up nearly twice as much. Foreclosures continue to be a problem, though they eased slightly, and inventory is shrinking.

"It's frenetic," said Jim Young, a senior vice president and sales manager with Edina Realty. "People are pleasantly exhausted."

Low inventory and a decline in distressed sales caused the median price of all closings during the month to increase 14.3 percent to $179,950 -- the biggest gain since January 2004.

The data is the latest in a series of local and national reports that suggest the housing market is working its way back from the bottom. Many experts expect a slow recovery across many parts of the nation.

"Laying claim to a recovering housing market does not ring of hyperbole, because it has been this way for several months," said Cari Linn, a sales agent with Coldwell Banker Burnet in Eden Prairie and MAAR's 2012 president.

By another measure, the price gains weren't quite so robust. MAAR's 10K House Value Index, which takes into consideration the seasonality of the market, a shift toward sales of higher-priced houses and other factors, increased 5.8 percent -- the fourth consecutive year-over-year gain.

Sellers weren't nearly as active as buyers. New listings increased only 1.9 percent, contributing to a 30.9 percent decline in inventory. Many would-be buyers are awaiting higher prices, and some can't sell because they still owe more than the house is worth.

Earlier this week, CoreLogic, which tracks repeat sales of the same house, said house prices across the country were up in most regions during June. In the Twin Cities, the group said that prices were up 2.3 percent compared with last year.

The market is not without its challenges. Because sales are increasing and listings continue to decline, the number of listings on the market has fallen to its lowest level since December 2003.

While that means multiple offers on properties in good condition and in high-demand locations, it also means many buyers can't find what they want. Some say that if inventory were better, the market would recover more quickly.

Economists also are concerned that there's a deep backlog of foreclosures that haven't yet hit the market,

Robert Shiller, Yale economist and co-author of the widely followed Case-Shiller housing report, said this week that he's not sure that the market has enough momentum to declare that a sustained recovery is underway.

In Minnesota the number of pre-foreclosure notices that are being sent to homeowners has been steadily declining, but remains at critically high levels. But those declines already are showing up in the form of fewer foreclosure sales in the Twin Cities.

During July distressed sales accounted for 33.9 percent of all new listings and 34.1 percent of all closings, the lowest since August 2008.

Herb Tousley, director of the real estate program at the Opus College of Business at the University of St. Thomas, says that while he expects the "shadow inventory" to hit the market gradually without much negative impact, he's anxiously anticipating sales activity during the next several months.

"This is a trend that started in February," he said. "But the rest of the year will really tell us a story about how durable the gains are that we're making."

Jim Buchta • 612-673-7376