The cortex integrates sound- and movement-related signals to predict the acoustic consequences of behavior and detect violations from expectations. Although expectation- and prediction-related activity has been observed in the auditory cortex of humans, monkeys, and mice during vocal and non-vocal acoustic behaviors, the specific cortical circuitry required for forming memories, recalling expectations, and making predictions remains unknown. By combining closed-loop behavior, electrophysiological recordings, longitudinal pharmacology, and targeted optogenetic circuit activation, we identify a cortical locus for the emergence of expectation and error signals. Movement-related expectation signals and sound-related error signals emerge in parallel in the auditory cortex and are concentrated in largely distinct neurons, consistent with a compartmentalization of different prediction-related computations. On a trial-by-trial basis, expectation and error signals are correlated in auditory cortex, consistent with a local circuit implementation of an internal model. Silencing the auditory cortex during motor-sensory learning prevents the emergence of expectation signals and error signals, revealing the auditory cortex as a necessary node for learning to make predictions. Prediction-like signals can be experimentally induced in the auditory cortex, even in the absence of behavioral experience, by pairing optogenetic motor cortical activation with sound playback, indicating that cortical circuits are sufficient for movement-like predictive processing. Finally, motor-sensory experience realigns the manifold dimensions in which auditory cortical populations encode movement and sound, consistent with predictive processing. These findings show that prediction-related signals reshape auditory cortex dynamics during behavior and reveal a cortical locus for the emergence of expectation and error.