Sparked by a switch in the mix of the homes changing hands, the Bay Area’s median housing price for June jumped to its highest level in nearly four years.

The median price paid for all houses and condos in the nine-county Bay Area last month reached $417,000, San Diego-based information service DataQuick reported Wednesday.

The median increased 4 percent from May and 10 percent from a year earlier. It was the highest level since August 2008 when it reached $447,000.

“While last month’s jump in the median sale price might to some extent reflect prices edging a bit higher in certain markets, mostly it’s a reflection of the change in market mix,” said DataQuick President John Walsh.

June sales were the reverse of those during the market’s steep downturn more than three years ago, he said. The number of foreclosure resales fell last month while sales picked up in the higher-end price segments.

Buyers last month purchased 8,577 new and resale homes. That was down nearly 3 percent from May, but up 7 percent from a year earlier.

Foreclosure resales accounted for 18 percent of June resales. It was first time that figure had dropped below 20 percent since January 2008. Foreclosure resales peaked at 52 percent in February 2009.

Short sales – transactions where the sale price fell short of what was owed on the property – made up an estimated 18 percent of resales, essentially unchanged from a year ago.

The median price peaked at $665,000 in June/July 2007, before tumbling to $290,000 in March 2009. DataQuick analysts estimate that about half that decline resulted from a decline in home values, while the other half reflected a shift in the sales mix.

Jumbo loans, mortgages above the old conforming limit of $417,000, accounted for 38 percent of June’s purchase loans. That was the highest level since December 2007 when it reached nearly 39 percent. Before August 2007, jumbos accounted for nearly 60 percent of the Bay Area purchase loan market.

— Robert Digitale