Pseudomonas aeruginosa colonizes the airways of cystic fibrosis (CF) patients, causing infections that can last for decades. During the course of these infections, P. aeruginosa undergoes a number of genetic adaptations. One such adaptation is the loss of swimming motility functions. Another involves the formation of the rugose small colony variant (RSCV) phenotype, which is characterized by overproduction of the exopolysaccharides Pel and Psl. Here, we provide evidence that the two adaptations are linked. Using random transposon mutagenesis, we discovered that flagellar mutations are linked to the RSCV phenotype. We found that flagellar mutants overexpressed Pel and Psl in a surface-contact dependent manner. Genetic analyses revealed that flagellar mutants were selected for at high frequencies in biofilms, and that Pel and Psl expression provided the primary fitness benefit in this environment. Suppressor mutagenesis of flagellar RSCVs indicated that Psl overexpression required the mot genes, suggesting that the flagellum stator proteins function in a surface-dependent regulatory pathway for exopolysaccharide biosynthesis. Finally, we identified flagellar mutant RSCVs among CF isolates. The CF environment has long been known to select for flagellar mutants, with the classic interpretation being that the fitness benefit gained relates to an impairment of the host immune system to target a bacterium lacking a flagellum. Our new findings lead us to propose that exopolysaccharide production is a key gain-of-function phenotype that offers a new way to interpret the fitness benefits of these mutations.