An active medical device have an improved diagnosis of a sleep apnea syndrome. This device measures the respiratory activity of the patient, determines a state of activity, this state being likely to take, according to satisfaction of predetermined criteria, a value representative of a state of sleep of the patient, and analyzes a detected signal corresponding to the respiratory activity to detect, when the aforementioned state is a state of sleep, the presence of respiratory pauses, and thereby to produce an indicating signal of sleep apnea in the event of the occurrence of a respiratory pause of duration longer than a first predetermined duration. The analysis also includes inhibiting the production of the aforesaid indicating signal, or a treatment to resolve an apnea, when the duration of the detected respiratory pause is longer than a second predetermined duration, typically of at least one minute.