Proposed algorithms for P-wave identification and segmentation usually search for it within a window just before the R peak, thus hypothesizing the presence of at most one P wave, as it is in a normal electrocardiographic (ECG) tracings. In presence of abnormal atrial depolarization, however, there might be no P waves (as in atrial fibrillation) or multiple P waves (as in second-or third-degree atrioventricular blocks). Thus, this study proposes a new Adaptive Threshold Identification Algorithm (AThrIA) for ECG P-waves whose most innovative feature is to look for P waves all along the heartbeat, potentially allowing multiple Pwaves identification. AThrIA ability to identify and segment (finding onset, maximum and offset) P waves was tested in simulated and experimental ECG tracings with no P waves, one P wave and two P waves, respectively. All P waves involved in the study were annotated. Results indicate that AThrIA correctly identified all P waves (no false-negative or false-positive detections). Segmentation errors were 0 ms for the simulated ECG tracings, and no more than 10 ms for the experimental tracings. Thus, AThrIA represents a promising tool for P-wave identification and segmentation in both physiological (one P wave) and pathological (none or multiple P waves) conditions.