A method and apparatus for preventing or terminating seizures, by stimulating a brain with at least two implanted electrodes, each implanted in a different one of at least two regions of the brain, with a frequency to emulate neuronal synchrony. Upon detecting a potential or actual seizure occurrence, the frequency is electrically applied to the brain upon the detection to preempt or terminate the potential or actual seizure occurrence. Parts in the brain, where brain electrical activity is being measured, that have the highest connectivity are determined by phase-locking coherence. The select subset of areas showing synchrony, i.e., only those with the highest coherence that will best permit inducing a large global synchrony, are stimulated to preempt or terminate the potential or actual seizure occurrence.