SAN DIEGO — Southern California home prices fell 31.1 percent in July from last year, with bargain hunters snapping up foreclosed properties and sending overall sales to a 16-month high, a research firm said Monday.

The median price for all homes and condo sales — including new and existing models — dropped to $348,000 in the six-county region last month, down from the market peak of $505,000 in July 2007 and down slightly from $355,000 in June, MDA DataQuick said.

A total of 20,329 homes and condos were sold during the month, up 13.8 percent from July 2007 and up 16.7 percent from June, the researcher said. It was the highest monthly tally since March 2007, when 21,856 homes were sold.

Foreclosures accounted for 43.6 percent of all resold properties last month, up from 7.9 percent in July 2007 and a revised 41.8 percent in June.

Foreclosures ranged from 22.2 percent of resold homes in Orange County last month to 64.4 percent in Riverside County. MDA DataQuick said foreclosures were at record highs and continue to be "the dominant factor" driving sales.

"What we're looking at is a fire sale of properties in newer affordable neighborhoods that were bought or refinanced near the price peak with lousy mortgages," said John Walsh, president of MDA DataQuick.

Distress sales have yet to reach older, more expensive neighborhoods, Walsh said.

The report covers sales in Los Angeles, Orange, San Diego, Riverside, San Bernardino and Ventura counties.