Successful cognitive control relies on both the ability to instantiate higher-order cognitive functions and the ability to flexibly switch between them in service of changing task demands, i.e. cognitive flexibility. While a wealth of important work on the development of cognitive control in adolescence has focused on the development of executive functions, there has been a relative lack of work on the development of cognitive flexibility. Here we address this limitation by investigating the development of cognitive flexibility using a task-switching paradigm in a large sample of adolescents and young adults (ages 14-32, n = 82). For a subset of subjects that had usable fMRI data (n=56), we assessed task-switching performance and analyzed fMRI data collected in-scanner while they performed the task-switching paradigm. We observed that successful task-switching was associated with widespread activation of frontoparietal and visual processing brain areas. A component of this larger task-switching system, the left inferior parietal cortex, showed age-related reductions in neural activation specifically during task-switching into trials that taxed inhibitory control. These neural findings occurred in parallel with age-related improvements in successful task-switching performance in the same context. This pattern of results suggests that task-switching into the most cognitively demanding contexts follows a protracted development that extends through adolescence and young adulthood. Further, the age-related reduction in parietal cortex activation suggests that adolescents have greater reliance on the frontoparietal system, which has been implicated in transient aspects of cognitive control, to achieve adult-like performance. Taken together, our results suggest that a key aspect of cognitive maturation in adulthood is the ability to flexibly switch between cognitive tasks with limited cost to performance and a decreasing reliance on frontoparietal regions across adolescence.