Pain is constructed through complex interactions among multiple brain systems, but it remains unclear how functional brain networks are reconfigured over time while experiencing pain. Here, we investigated the time-varying changes in the functional brain networks during 20 min capsaicin-induced sustained orofacial pain. In the early stage, the orofacial areas of the primary somatomotor cortex were separated from other areas of the somatosensory cortex and integrated with subcortical and frontoparietal regions, constituting an extended brain network of sustained pain. As pain decreased over time, the subcortical and frontoparietal regions were separated from this brain network and connected to multiple cerebellar regions. Machine-learning models based on these network features showed significant predictions of changes in pain experience across two independent datasets (n = 48 and 74). This study provides new insights into how multiple brain systems dynamically interact to construct and modulate pain experience, advancing our mechanistic understanding of sustained pain.