MDA DataQuick said sales of homes and condos in the San Francisco Bay Area surged 45 percent in September from a year ago — the largest leap since April, 2002 — but the median home price slipped 40 percent from last year’s peak as the mix of sales included more inland foreclosures.

Nearly 42 percent of all existing homes sold around the Bay Area last month were foreclosed on at some point in the last 12 months, compared to 36.1 percent in August and 6.9 percent a year ago, according to DataQuick.