A cardiac stimulation device uses dynamic overdrive pacing to prevent sleep apnea. In another aspect, the device can use dynamic overdrive pacing to terminate sleep apnea after detection. An implantable cardiac stimulation device comprises a sensor and one or more pulse generators. The sensor senses intrinsic cardiac electrical phenomena. The pulse generators can generate cardiac pacing pulses with timing based on the sensed intrinsic cardiac electrical phenomena to dynamically overdrive the intrinsic cardiac electrical phenomena. The timed cardiac pacing pulses can prevent a sleep apnea condition.