Diatoms contribute roughly 20% of global primary production, but the factors determining their ability to adapt to global warming are unknown. Here we quantify the capacity for adaptation to warming in the marine diatom Thalassiosira pseudonana. We found that evolutionary rescue under severe warming was slow but adaptation to more realistic scenarios, where temperature increases were moderate or where they fluctuated between benign and severe conditions, was rapid. Adaption to warming was linked to major phenotypic changes in metabolism and elemental composition. Whole genome re-sequencing identified significant genetic divergence both among populations adapted to the different warming regimes and between the evolved and ancestral linages. Consistent with the phenotypic changes, the most rapidly evolving genes were associated with photosynthetic, transcriptional and translational processes. These results demonstrate that evolution of thermal tolerance in marine diatoms can be rapid, particularly in fluctuating environments, and is underpinned by major genomic and phenotypic divergence.