The ability to detect and sort overlapping spike waveforms in extracellular recordings is key to studies of neural coding at high spatial and temporal resolution. Most spike-sorting algorithms are based on initial spike detection (e.g. by a voltage threshold) and subsequent waveform classification. Much effort has been devoted to the clustering step, despite the fact that conservative spike detection is notoriously difficult in low signal-to-noise conditions and often entails many spike misses. 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.