A method is provided, including identifying that a subject is at risk of suffering from atrial fibrillation (AF). Responsively to the identifying, a risk of an occurrence of an episode of the AF is reduced by applying an electrical current to a site of the subject selected from the group consisting of: a vagus nerve, a sinoatrial (SA) node fat pad, a pulmonary vein, a carotid artery, a carotid sinus, a coronary sinus, a vena cava vein, a jugular vein, an azygos vein, an innominate vein, and a subclavian vein, and configuring the current to stimulate autonomic nervous tissue in the site. Other embodiments are also described.