In this paper, we developed and evaluated a robust single-lead electrocardiogram (ECG) delineation system based on the wavelet transform (WT). In a first step, QRS complexes are detected. Then, each QRS is delineated by detecting and identifying the peaks of the individual waves, as well as the complex onset and end. Finally, the determination of P and T wave peaks, onsets and ends is performed. We evaluated the algorithm on several manually annotated databases, such as MIT-BIH Arrhythmia, QT, European ST-T and CSE databases, developed for validation purposes. The QRS detector obtained a sensitivity of Se = 99.66% and a positive predictivity of P+ = 99.56% over the first lead of the validation databases (more than 980,000 beats), while for the well-known MIT-BIH Arrhythmia Database, Se and P+ over 99.8% were attained. As for the delineation of the ECG waves, the mean and standard deviation of the differences between the automatic and manual annotations were computed. The mean error obtained with the WT approach was found not to exceed one sampling interval, while the standard deviations were around the accepted tolerances between expert physicians, outperforming the results of other well known algorithms, especially in determining the end of T wave.