An implantable medical device, IMD, (100) is designed to collect a signal representative of the electric activity of the heart (10) and determine a cardiogenic impedance signal for at least a portion of the heart (10). An R-wave detector (132) of the IMD 100 detects the timing of an R-wave during a cardiac cycle based on the signal representative of the electric activity. A minimum detector (133) detects the timing of a cardiogenic impedance minimum in the cardiogenic impedance signal and within a systolic time window of the cardiac cycle. A detected arrhythmia is then classified by the IMD (100) based on the timing of the R-wave detected by the R-wave detector (132) and the timing of the cardiogenic impedance minimum detected by the minimum detector (133).