A novel power-line interference (PLI) detection and suppression algorithm is proposed to pre-process real-time electrocardiogram (ECG) signals. This algorithm first compares the energy at the harmonic frequency against the energy at neighboring frequencies of the ECG power spectrum, and employs an optimal linear discriminant analysis (LDA) algorithm to determine whether PLI interference exists in the ECG signal. If the presence of PLI is detected, it then applies a recursive least square (RLS) adaptive notch filter to suppress the interference. Extensive simulation results indicate that the algorithm consistently exhibits superior performance in terms of less ECG distortion, faster convergence rate and numerical stability.