An implantable medical device is connectable to at least three electrodes, and includes an immittance measurer that performs immittance measurements within the heart of a patient using at least three electrodes coupled to the device, with at least one of the electrodes is arranged in an atrium of the patients heart. The medical device further includes an immittance converter that converts the immittance measurement values into individual near-field immittance values of the at least one electrode arranged in an atrium, an atrial dilatation detector that detects atrial dilatation based upon the individual near-field immittance values, and that determines atrial dilatation values in dependence thereon, and an atrial fibrillation risk determiner that determines an atrial fibrillation risk index based upon the atrial dilatation values.