Last year was a grim time in the real estate market, wasn't it? Foreclosures, falling values, the credit crunch.

Nonetheless, in Santa Clara County more homes sold for $5 million or more than at any time since the dot-com-nirvana year of 2000. And in San Mateo County — home to luxury-home strongholds like Atherton and Woodside — it was a record-breaking year for sales of super-expensive castles.

Only in the final quarter of 2008 did the recession finally bite into the top end of the market, sending sales plummeting. While the super rich weathered the early days of the credit crisis far better than most, experts say, last fall's stock market crash drastically impaired their ability to snap up multi-million-dollar manses.

At least 31 homes in Santa Clara County and 60 in San Mateo County sold for $5 million or more in 2008, according to MDA DataQuick, which gathered the information from public records. There were probably even more such sales, the company said, because buyers and sellers of very expensive homes often opt to "hide" the price when their deeds are recorded.

More