Dopamine is classically thought to drive learning based on errors in the prediction of rewards and punishments. However, animals also learn to predict cues with no intrinsic value, and it is unclear if such latent learning also relies on dopaminergic prediction errors. Here, we tested this by recording dopamine release in the nucleus accumbens and dorsomedial striatum while rats executed a sensory preconditioning task that incorporates both types of learning. We found that dopamine release in both regions correlated with errors in predicting value-neutral cues during latent learning and with errors in predicting reward during reward-based conditioning. Moreover, dopamine in the nucleus accumbens reflected inferred value in the probe test, supported by orbitofrontal cortex activity. Our findings suggest that dopamine signals a multi-factorial prediction error, capable of supporting model-based learning.