Spinal microglia are highly responsive to peripheral nerve injury and are known to be a key player in pain. However, there has not been direct evidence showing that selective microglial activation in vivo is sufficient to induce chronic pain. Here, we used optogenetic approaches in microglia to address this question employing CX3CR1creER/+: R26LSL-ReaChR/+ transgenic mice, in which red-activated channelrhodopsin (ReaChR) is inducibly and specifically expressed in microglia. We found that activation of ReaChR by red light in spinal microglia evoked reliable inward currents and membrane depolarization. In vivo optogenetic activation of microglial ReaChR in the spinal cord triggered chronic pain hypersensitivity in both male and female mice. In addition, activation of microglial ReaChR up-regulated neuronal c-Fos expression and enhanced C-fiber responses. Mechanistically, ReaChR activation led to a reactive microglial phenotype with increased interleukin (IL)-1β production, which is likely mediated by inflammasome activation and calcium elevation. IL-1 receptor antagonist (IL-1ra) was able to reverse the pain hypersensitivity and neuronal hyperactivity induced by microglial ReaChR activation. Therefore, our work demonstrates that optogenetic activation of spinal microglia is sufficient to trigger chronic pain phenotypes by increasing neuronal activity via IL-1 signaling.