About 500 million years ago, a new type of adaptive immune defense emerged in basal jawed vertebrates, accompanied by morphological innovations, including the thymus. Did these evolutionary novelties arise de novo or from elaboration of ancient genetic networks? We reconstructed the genetic changes underlying thymopoiesis by comparative genome and expression analyses in chordates and basal vertebrates. The derived models of genetic networks were experimentally verified in bony fishes. Ancestral networks defining circumscribed regions of the pharyngeal epithelium of jawless vertebrates expanded in cartilaginous fishes to incorporate novel genes, notably those encoding chemokines. Correspondingly, novel networks evolved in lymphocytes of jawed vertebrates to control the expression of additional chemokine receptors. These complementary changes enabled unprecedented Delta/Notch signaling between pharyngeal epithelium and lymphoid cells that was exploited for specification to the T cell lineage. Our results provide a framework elucidating the evolution of key features of the adaptive immune system in jawed vertebrates.