The neural basis of flexible cognitive control in humans remains one of the most fascinating mysteries in neuroscience. Evidence from numerous studies indicates that the prefrontal cortex (PFC) constitutes the structural basis underlying flexible behavior. However, the neural mechanisms by which the PFC optimizes integration of goal-relevant information while minimizing interference from goal-irrelevant information to support flexible behavior remain elusive. Here, using direct recordings from the human brain, we show that the PFC resolves cognitive interference between competing features by transforming their representational population geometry into distinct neural subspaces to accommodate flexible task-switching. These results uncover a fundamental neural coding principle that constitutes a central building block of human flexible cognitive control.