Reward-evoked dopamine is well-established as a prediction error. However the central tenet of temporal difference accounts - that similar transients evoked by reward-predictive cues also function as errors - remains untested. To address this, we used two phenomena, second-order conditioning and blocking, in order to examine the role of dopamine in prediction error versus reward prediction. We show that optogenetically-shunting dopamine activity at the start of a reward-predicting cue prevents second-order conditioning without affecting blocking. These results support temporal difference accounts by providing causal evidence that cue-evoked dopamine transients function as prediction errors.