Atrial fibrillation (AF) is detected based on pulmonary artery pressure (PAP) data. In some embodiments, PAP data generated by a PAP sensor device implanted in or near the pulmonary artery of a patient is processed to determine whether the patient is suffering from AF. In some aspects, detection of AF is based on identifying cycle-to-cycle variations of one or more parameters derived from the PAP data.