Bacterial infection and inflammation of the airways are the leading causes of morbidity and mortality in persons with cystic fibrosis (CF). The ecology of the bacterial communities inhabiting CF airways is poorly understood, especially with respect to how community structure, dynamics, and microbial metabolic activity relate to clinical outcomes. In this study, the bacterial communities in 818 sputum samples from 109 persons with CF were analyzed by sequencing bacterial 16S rRNA gene amplicons. We identified eight alternative community types (pulmotypes) by using a Dirichlet multinomial mixture model and studied their temporal dynamics in the cohort. Across patients, the pulmotypes displayed chronological patterns in the transition among each other. Furthermore, significant correlations between pulmotypes and patient clinical status were detected by using multinomial mixed effects models, principal components regression, and statistical testing. Constructing pulmotype-specific metabolic activity profiles, we found that pulmotype microbiota drive distinct community functions including mucus degradation or increased acid production. These results indicate that pulmotypes are the result of ordered, underlying drivers such as predominant metabolism, ecological competition, and niche construction and can form the basis for quantitative, predictive models supporting clinical treatment decisions.