Hidden Markov models (HMMs) can serve as generative models for continuous extracellular data records. These models naturally combine the spike detection and classification steps into a single computational procedure. They unify the advantages of independent component analysis (ICA) and overlap-search algorithms because they blindly perform source separation even in cases where several neurons are recorded on a single electrode. We apply HMMs to artificially generated data and to extracellular signals recorded with glass electrodes. We show that in comparison with state-of-art spike-sorting algorithms, HMM-based spike sorting exhibits a comparable number of false positive spike classifications but many fewer spike misses.