Stenotrophomonas maltophilia is an opportunistic pathogen infecting persons with cystic fibrosis (pwCF) and portends a worse prognosis. Studies of S. maltophilia infection dynamics have been limited by cohort size and follow-up. We investigated the natural history, transmission potential, and evolution of S. maltophilia in a large Canadian cohort of 321 pwCF over a 37-year period. One-hundred sixty-two isolates from 74 pwCF (23%) were typed by pulsed-field gel electrophoresis, and shared pulsotypes underwent whole-genome sequencing. S. maltophilia was recovered at least once in 82 pwCF (25.5%). Sixty-four pwCF were infected by unique pulsotypes, but shared pulsotypes were observed between 10 pwCF. In chronic carriage, longer time periods between positive sputum cultures increased the likelihood that subsequent isolates were unrelated. Isolates from individual pwCF were largely clonal, with differences in gene content being the primary source of genetic diversity objectified by gene content differences. Disproportionate progression of CF lung disease was not observed amongst those infected with multiple strains over time (versus a single) or amongst those with shared clones (versus strains only infecting one patient). We did not observe evidence of patient-to-patient transmission despite relatedness between isolates. Twenty-four genes with ≥ 2 mutations accumulated over time were identified across 42 sequenced isolates from all 11 pwCF with ≥ 2 sequenced isolates, suggesting a potential role for these genes in adaptation of S. maltophilia to the CF lung. Genomic analyses suggested common, indirect sources as the origins of S. maltophilia infections in the clinic population. The information derived from a genomics-based understanding of the natural history of S. maltophilia infection within CF provides unique insight into its potential for in-host evolution.