An apparatus for terminating an atrial fibrillation of an atrium of a heart comprises: (i) at least one sensor configured to provide an electric signal representative of the present electric state of the atrium; (ii) a determination unit configured to determine from the electrical signal whether the present electric state of the biological tissue is an atrial fibrillation; (iii) an electric pulse generator for generating at least one series of electric low energy anti-fibrillation pacing pulses at intervals depending on the electrical signal; (iv) at least one electrode connected to the pulse generator configured to apply the low energy anti-fibrillation pacing pulses to the atrium; (v) at least one further sensor configured to provide a further electric signal representative of an ventricular action potential of a ventricle of the heart; (vi) a further electric pulse generator configured to generate electric pacing pulses; (vii) at least one further electrode connected to the further pulse generator and configured to apply the electric pacing pulses to the ventricle; and (viii) a synchronization unit configured to synchronize the at least one series of low energy anti-fibrillation pacing pulses with the electric pacing pulses such that no low energy anti-fibrillation pacing pulse of the at least one series of low energy anti-fibrillation pacing pulses is applied in a vulnerable window during which the ventricle is susceptible to shock-induced ventricular fibrillation.