The National Association of Realtors was out Wednesday with its second-quarter analysis of home sales and prices, which showed a mixed market in which prices rose in 41 of 151 metro areas, mostly those in which home-price appreciation was minimal during the housing boom.

The median existing-home price declined 2.8% to $171,900 during the quarter on a year-over-year basis, the NAR said. Distressed properties, which typically sell at a 20% discount to market, accounted for 33% of second quarter sales, down from 39% in the first quarter but up from 32% during the same quarter last year, according to the Realtor group.

The NAR does not report pricing data excluding distressed properties.However, NAR Chief Economist Lawrence Yun explained, "The level of foreclosures, which can artificially depress median prices, can vary notably in given markets. The annual price gauge smoothes out the quarterly swings and has shown fairly stable price trends in most markets."

Total state existing-home sales, including single-family and condo, declined 5.4% to a seasonally adjusted annual rate of 4.86 million in the quarter from the first quarter, 12.7% below a 5.57 million pace during the second quarter of 2010, when federal and state home-buyer tax credits were in effect.

All-cash purchases accounted for 30% of sales during the quarter, up from 25% a year earlier, and investors made up 19% of the market, up from 14% in the second quarter of last year. First-time buyers comprised 35% of sales, down from 46% a year earlier, and 56% were repeat buyers, up from 40%.

Regionally, the median single-family price in the Northeast rose 2% from last year's second quarter to $245,600 as sales declined 4.6% to an annual pace of 763,000, 19.9% below a year earlier. The price in the Midwest fell 5.4% to $139,800; sales dropped 3.1% to a pace of 1.05 million, 18.3% last year's quarter. Prices in the South lost 2.7% to $153,000 as sales fell 3.4% to an annual rate of 1.89, 9.9% below the pace of a year earlier. The West declined 3.1% to $218,000; sales were down 10.8% to an annual rate of 1.16 million, 6.2 percent below last year's quarter.

Metro area condominium and cooperative prices in 54 metro areas showed the national median existing-condo price was $169,200 in the second quarter, 3.5% below second quarter, 2010.

Said Yun, "Median home prices have been moving up and down in a relatively narrow range in many markets, which shows a stabilization trend...With home prices in a broad trough and historically low mortgage interest rates, high housing affordability conditions and rising rents could stimulate a more rapid sales recovery if banks get back into the business of lending to more creditworthy borrowers."

The Realtors' Housing Affordability Index was 176.6 in the second quarter, the third highest after the first quarter of 2011 and fourth quarter of 2010 on records going back to 1970.

Among individual markets, patterns remained similar to those seen through much of the housing market decline. Markets with price gains included Washington D.C. (+2.7%), Dallas (+12.5%), Houston (+0.4%) Austin (+1.4%), Amarillo (+2.4%), Abilene (+7.5%) and San Antonio (+2.8%). In Florida, Ft.Myers, hard hit during the housing crash, posted a 17.9% increase in median price, albeit to an exceedingly low level of $110,900. Charlotte rose 6% to $211,100.

The core New York metro including the city, Westchester County and the North Jersey close-in suburbs was up 1.2% to $448,700. The wider metro, including all of Northern Jersey and Long Island, was down 2.3% to $384,800.

California was down all around, with Los Angeles down 4.3% to $292,300, San Francisco down 6.4% to $515,100, San Diego down 3.4% to $379,300, San Jose down 3.2% to $610,000, Sacramento down 12.5% to $168,000, Anaheim down 3.6% to $536,700 and the Inland Empire down 6.2% to $171,500.

Las Vegas was down 11.3% to $126,200; Phoenix down 12.9% to $126,000.

In the Midwest, Minneapolis dropped 17.7% to $145,000 and Chicago fell 9.8% to $185,000.

In Florida, Miami dropped 13% to $186,300; Tampa fell 8.3% to $129,600; Sarasota/Bradenton/Venice fell 15% to $157,000; Orlando dropped 10.4% to $125,600; and Jacksonville declined 3.5% to $134,200.

Denver was relatively flat (-0.9%) at $232,700. Seattle was down 6.5% to $287,200. Boston was off 1.4% to $355,700.

Learn more about markets featured in this article: Los Angeles, CA.