The reinforcing and rewarding properties of cocaine are attributed to its ability to increase dopaminergic transmission in nucleus accumbens (NAc). This action reinforces drug taking and seeking and leads to potent and long-lasting associations between the rewarding effects of the drug and the cues associated with its availability. The inability to extinguish these associations is a key factor contributing to relapse. Dopamine produces these effects by controlling the activity of two subpopulations of NAc medium spiny neurons (MSNs) that are defined by their predominant expression of either dopamine D1 or D2 receptors. Previous work has demonstrated that optogenetically stimulating D1 MSNs promotes reward, whereas stimulating D2 MSNs produces aversion. However, we still lack a clear understanding of how the endogenous activity of these cell types is affected by cocaine and encodes information that drives drug-associated behaviors. Using fiber photometry calcium imaging we define D1 MSNs as the specific population of cells in NAc that encodes information about drug associations and elucidate the temporal profile with which D1 activity is increased to drive drug seeking in response to contextual cues. Chronic cocaine exposure dysregulates these D1 signals to both prevent extinction and facilitate reinstatement of drug seeking to drive relapse. Directly manipulating these D1 signals using designer receptors exclusively activated by designer drugs prevents contextual associations. Together, these data elucidate the responses of D1- and D2-type MSNs in NAc to acute cocaine and during the formation of context-reward associations and define how prior cocaine exposure selectively dysregulates D1 signaling to drive relapse.