Effective and safe pharmaceutical composition and method for treating atrial fibrillation are described. The combined use of dofetilide and mexiletine resulted in an enhanced efficacy in the prevention and treatment of atrial fibrillation with markedly reduced risk of the life-threatening ventricular arrhythmia TdP.