Diatoms are ancestrally photosynthetic microalgae, but the genus Nitzschia has lost photosynthesis to become free-living secondary heterotrophs. This study shows how a single horizontal gene transfer from marine bacteria, followed by substantial gene duplication and neofunctionalization, led to alginate catabolism and access to a new ecological niche involving brown algal polysaccharides.