Microglia are resident immune cells of the central nervous system and play key roles in brain homeostasis. During anesthesia, microglia increase their dynamic process surveillance and interact more closely with neurons. However, the functional significance of microglial process dynamics and neuronal interaction under anesthesia is largely unknown. Using in vivo two-photon imaging in mice, we show that microglia enhance neuronal activity after the cessation of isoflurane anesthesia. Hyperactive neuron somata are contacted directly by microglial processes, which specifically colocalize with GABAergic boutons. Electron-microscopy-based synaptic reconstruction after two-photon imaging reveals that, during anesthesia, microglial processes enter into the synaptic cleft to shield GABAergic inputs. Microglial ablation or loss of microglial β2-adrenergic receptors prevents post-anesthesia neuronal hyperactivity. Our study demonstrates a previously unappreciated function of microglial process dynamics, which enable microglia to transiently boost post-anesthesia neuronal activity by physically shielding inhibitory inputs.