BACKGROUND: Cocaine use is often associated with diminished cognitive function, persisting even after abstinence from the drug. Likely targets for these changes are the core and shell of the nucleus accumbens (NAc), which are critical for mediating the rewarding aspects of drugs of abuse as well as supporting associative learning. To understand this deficit, we recorded neural activity in the NAc of rats with a history of cocaine self-administration or control subjects while they learned Pavlovian first- and second-order associations. METHODS: Rats were trained for 2 weeks to self-administer intravenous cocaine or water. Later, rats learned a first-order Pavlovian discrimination where a conditioned stimulus (CS)+ predicted food, and a control (CS-) did not. Rats then learned a second-order association where, absent any food reinforcement, a novel cued (SOC+) predicted the CS+ and another (SOC-) predicted the CS-. Electrophysiological recordings were taken during performance of these tasks in the NAc core and shell. RESULTS: Both control subjects and cocaine-experienced rats learned the first-order association, but only control subjects learned the second-order association. Neural recordings indicated that core and shell neurons encoded task-relevant information that correlated with behavioral performance, whereas this type of encoding was abolished in cocaine-experienced rats. CONCLUSIONS: The NAc core and shell perform complementary roles in supporting normal associative learning, functions that are impaired after cocaine experience. This impoverished encoding of motivational behavior, even after abstinence from the drug, might provide a key mechanism to understand why addiction remains a chronically relapsing disorder despite repeated attempts at sobriety.