An implantable cardiac stimulator includes a cardioversion/defibrillation unit connected to at least one electrode pair for generation and delivery of cardioversion or defibrillation shocks; an atrial sensing unit detecting atrial contraction, and outputting an atrial sensing signal indicating a atrial event when an atrial contraction is detected; a ventricular sensing unit detecting ventricular contraction, and outputting a ventricular sensing signal when a ventricular contraction is detected; a tachycardia detection unit connected to the atrial and ventricular sensing units and detecting a tachycardia, and classifying it as a ventricular tachycardia (VT) or as a supraventricular tachycardia (SVT); and a treatment control unit designed to trigger at least one atrial cardioversion shock when a ventricular rhythm detected by the ventricular sensing unit is faster than a programmed frequency limit, and the tachycardia detection unit classifies an SVT as an atrial fibrillation (AFib).