The role of selenium in proteins and nucleic acids is well-established, but the pathway for incorporating selenium into small molecules remains unknown. Now, using bioinformatics tools, a selenium-incorporating gene cluster is discovered from immense genomic data, leading to the identification of selenoneine from microorganisms and the elucidation of a selenium incorporation pathway.