Complete atrioventricular block (type III AVB) is characterized by an absence of P wave transmission to ventricles. This implies that QRS complexes are generated in an autonomous way and are not coordinated with P waves. This work introduces a new algorithm for the detection of P waves for this type of pathology using noninvasive electrocardiographic surface leads. The proposed algorithm is divided into three stages. In the first stage, the R waves located by a QRS detector are used to generate the RR series and time references for the other stages of the algorithm. In the second stage, the ventricular activity (QT segment) is removed by using an adaptive filter that obtains an averaged pattern of the QT segment. In the third stage, a new P wave detector is applied to the residual signal obtained after QT cancellation in order to detect P wave locations and get the PP time series. Eight Holter records from patients with congenital type III AVB were used to verify the proposed algorithm. Although further improvements should be made to improve the algorithm's performance, the results obtained show high average values of sensitivity (90.52%) and positive prediction (90.98%).