A detailed kinetic model of the Ca2+/calmodulin-dependent protein kinase II (CaMKII) is presented in which subunits undergo autophosphorylation at several sites in a manner that depends on the frequency and duration of Ca2+ spikes. It is shown that high-frequency stimulation causes autophosphorylation of the autonomy site (Thr286), and promotes persistent catalytic activity. On the other hand, low-frequency stimulation is shown to cause autophosphorylation of an inhibitory site (Thr306), which prevents subunit activation. This site-selective autophosphorylation provides the basis for a molecular switch. When activated by a strong stimulus, the switch remains on for many minutes, even in the presence of a CaMKII-specific phosphatase. However, prolonged low-frequency stimulation disables the switch, and influences the response to subsequent stimulation. It is conceivable that a regulatory mechanism such as this may permit CaMKII to mediate synaptic frequency encoding and thereby direct an appropriate change in synaptic efficacy. It is indicated how the behavior of the model may relate to the induction of long-term potentiation.