A method and system for treating cardiac arrhythmias which includes inserting one or more electrodes into a patients neck, and connecting the electrodes to the vagus nerve in the patients neck. A cardiac monitoring device detects a cardiac arrhythmia. A controller connected to an electrical power source provides electrical power to the electrodes to apply electrical stimulation to the vagus nerve when a cardiac arrhythmia is detected.