The present invention uses electrical stimulation of the vagus nerve to treat epilepsy with minimized or no effect on the heart. Treatment is carried out by an implantable signal generator, one or more implantable electrodes for electrically stimulating a predetermined stimulation site of the vagus nerve, and a sensor for sensing characteristics of the heart such as heart rate. The heart rate information from the sensor can be used to determine whether the vagus nerve stimulation is adversely affecting the heart. Once threshold parameters are met, the vagus nerve stimulation may be stopped or adjusted. In yet another embodiment, the invention may be simply a modified pacemaker having circuitry that determines whether a vagus nerve is being stimulated. In the event that the vagus nerve is being stimulated, the modified pacemaker may control the heart to maintain it within desired conditions during the vagus nerve stimulation.