Repetitive exposure to addictive drugs causes synaptic modification in the mesocorticolimbic dopamine (DA) system. Dopamine D1 receptors (D1R) or D2 receptors (D2R) expressed in the medium spiny neurons (MSNs) of the nucleus accumbens (NAc) play critical roles in the control of addictive behaviors. Optogenetic activation of D2R-expressing MSNs (D2R-MSNs) in the NAc previously demonstrated that these neurons play a key role in withdrawal-induced plasticity. Here, we examined the effect of optogenetic inhibition of D2R-MSNs in the NAc on cocaine-induced behavioral sensitization. Adeno-associated viral vectors encoding archaerhodopsin (ArchT) were delivered into the NAc of D2-Cre transgenic mice. Activation of ArchT produced photoinhibition of D2R-MSNs and caused disinhibition of neighboring MSNs in the NAc. However, such optogenetic silencing of D2R-MSNs in the NAc in vivo affected neither the initiation nor the expression of cocaine-induced behavioral sensitization. Similarly, photoinhibition of NAc D2R-MSNs in the NAc during the drug withdrawal period did not affect the expression of cocaine-induced behavioral sensitization. More detailed analysis of the effects of optogenetic activation of D2R-MSNs suggests that D2R-MSNs in the NAc exert important modulatory effects on neighboring MSN neurons, which may control the balanced output of NAc MSNs to control addictive behaviors.