Neurons in the prefrontal cortex (PFC) can provide top-down regulation of sensory-affective experiences such as pain. Bottom-up modulation of sensory coding in the PFC, however, remains poorly understood. Here, we examined how oxytocin (OT) signaling from the hypothalamus regulates nociceptive coding in the PFC. In vivo time-lapse endoscopic calcium imaging in freely behaving rats showed that OT selectively enhanced population activity in the prelimbic PFC in response to nociceptive inputs. This population response resulted from the reduction of evoked GABAergic inhibition and manifested as elevated functional connectivity involving pain-responsive neurons. Direct inputs from OT-releasing neurons in the paraventricular nucleus (PVN) of the hypothalamus are crucial to maintaining this prefrontal nociceptive response. Activation of the prelimbic PFC by OT or direct optogenetic stimulation of oxytocinergic PVN projections reduced acute and chronic pain. These results suggest that oxytocinergic signaling in the PVN-PFC circuit constitutes a key mechanism to regulate cortical sensory processing.