A computational model that is able to generate sequences at arbitrary rates in a given serial order is presented for the cortico-basal ganglia (BG)–thalamic neural circuitry. Upon generating a sequence, this model stores information on the serial order of components in a cortical buffer by means of theta-nested gamma frequency oscillations observed experimentally in cortico-striatal neurons. This model assumes the existence of at least two functionally different classes of striatal spiny neurons. One class of striatal projection neurons (S-cells) select the first component in the cortical buffer through a temporal winner-take-all mechanism implemented by lateral inhibition. The inhibition should last for at least a few hundred milliseconds. In reality, it may be mediated by GABA B receptors at the presynaptic terminals of the cortico-striatal projection. The other class of striatal projection neurons (M-cells) retain the currently executed component in a cortico-BG–thalamic loop, for which the strong nonlinearity in transitions between up and down states of striatal neurons is crucial. For sequence generation at the level of striatum, the cortical neurons encoding the component selected for execution are inactivated by the feedback from the activated cortico-BG–thalamic loop. This model predicts that the transition to next component is triggered by a single external signal, i.e. the subthalamic input to the globus pallidum. This input gives a neural substrate for adjusting the rate of sequence generation.