Although chronic cocaine-induced changes in dendritic spines on nucleus accumbens (NAc) neurons have been correlated with behavioral sensitization, the molecular pathways governing these structural changes, and their resulting behavioral effects, are poorly understood. The transcription factor, nuclear factor kappa B (NFkappaB), is rapidly activated by diverse stimuli and regulates expression of many genes known to maintain cell structure. Therefore, we evaluated the role of NFkappaB in regulating cocaine-induced dendritic spine changes on medium spiny neurons of the NAc and the rewarding effects of cocaine. We show that chronic cocaine induces NFkappaB-dependent transcription in the NAc of NFkappaB-Lac transgenic mice. This induction of NFkappaB activity is accompanied by increased expression of several NFkappaB genes, the promoters of which show chromatin modifications after chronic cocaine exposure consistent with their transcriptional activation. To study the functional significance of this induction, we used viral-mediated gene transfer to express either a constitutively active or dominant-negative mutant of Inhibitor of kappa B kinase (IKKca or IKKdn), which normally activates NFkappaB signaling, in the NAc. We found that activation of NFkappaB by IKKca increases the number of dendritic spines on NAc neurons, whereas inhibition of NFkappaB by IKKdn decreases basal dendritic spine number and blocks the increase in dendritic spines after chronic cocaine. Moreover, inhibition of NFkappaB blocks the rewarding effects of cocaine and the ability of previous cocaine exposure to increase an animal's preference for cocaine. Together, these studies establish a direct role for NFkappaB pathways in the NAc to regulate structural and behavioral plasticity to cocaine.