The invention relates to an active implantable pacemaker. The device analyzes a ventricular electrogram signal (EGM) and is able to recognize, in a search window, an EA4 component of endocardial acceleration (EA) associated with atrial activity. In the presence of atrioventricular conduction, the search window is determined based on the temporal position of the EA1 and/or EA2 components of the EA signal. In the absence of atrioventricular conduction, a delay is counted from a paced ventricular event and applied to mask the EA1 and/or EA2 components in the EA signal, and the window for research of the EA4 component follows the masking delay. In the presence of a confirmed EA4 component, an atrioventricular delay is applied, counted from the EA4 component, and in the opposite case a predetermined escape interval is applied, counted from the last stimulated ventricular event.