Behavioral sequences of animals are often structured and can be described by probabilistic rules (or "action syntax"). The patterns of vocal elements in birdsong are a prime example. The encoding of such rules in neural circuits is poorly understood. Here we locate the site of song syntax in the Bengalese finch by rapidly and reversibly manipulating the temperature in the song production pathway. Changing the temperature in the premotor nucleus HVC (proper name) alters the transition probabilities between syllables. Most prominently, cooling reduces the number of repetitions of long repeated syllables, while heating increases repetition. In contrast, changing the temperature of the downstream motor area RA (robust nucleus of the acropallium), which is critical for singing, does not affect the song syntax. Computational modeling suggests that temperature can alter the transition probabilities by affecting the efficacy of the synapses in HVC that carry auditory feedback to the motor circuits. The model is supported by a real-time distorted auditory feedback experiment, which shows that perturbing auditory feedback shortens syllable repeats similar to cooling HVC. Taken together, these findings implicate HVC as a key player in determining birdsong syntax.