General anesthesia leads to a loss of consciousness and an unrousable state in patients. Although general anesthetics are widely used in clinical practice, their underlying mechanisms remain elusive. The potential involvement of nonneuronal cells is unknown. Microglia are important immune cells in the central nervous system (CNS) that play critical roles in CNS function and dysfunction. We unintentionally observed delayed anesthesia induction and early anesthesia emergence in microglia-depleted mice. We found that microglial depletion differentially regulates neuronal activities by suppressing the neuronal network of anesthesia-activated brain regions and activating emergence-activated brain regions. Thus, microglia facilitate and stabilize the anesthesia status. This influence is not mediated by dendritic spine plasticity. Instead, it relies on the activation of microglial P2Y12 and subsequent calcium influx, which facilitates the general anesthesia response. Together, we elucidate the regulatory role of microglia in general anesthesia, extending our knowledge of how nonneuronal cells modulate neuronal activities.