The dynamic core hypothesis posits that consciousness is correlated with simultaneously integrated and differentiated assemblies of transiently synchronized brain regions. We represented time-dependent functional interactions using dynamic brain networks and assessed the integrity of the dynamic core by means of the size and flexibility of the largest multilayer module. As a first step, we constrained parameter selection using a newly developed benchmark for module detection in heterogeneous temporal networks. Next, we applied a multilayer modularity maximization algorithm to dynamic brain networks computed from functional magnetic resonance imaging (fMRI) data acquired during deep sleep and under propofol anesthesia. We found that unconsciousness reconfigured network flexibility and reduced the size of the largest spatiotemporal module, which we identified with the dynamic core. Our results represent a first characterization of modular brain network dynamics during states of unconsciousness measured with fMRI, adding support to the dynamic core hypothesis of human consciousness.