Mycobacterium tuberculosis uses sophisticated secretion systems, named 6 kDa early secretory antigenic target (ESAT6) protein family secretion (ESX) systems (also known as type VII secretion systems), to export a set of effector proteins that helps the pathogen to resist or evade the host immune response. Since the discovery of the esx loci during the M. tuberculosis H37Rv genome project, structural biology, cell biology and evolutionary analyses have advanced our knowledge of the function of these systems. In this Review, we highlight the intriguing roles that these studies have revealed for ESX systems in bacterial survival and pathogenicity during infection with M. tuberculosis. Furthermore, we discuss the diversity of ESX systems that has been described among mycobacteria and selected non-mycobacterial species. Finally, we consider how our knowledge of ESX systems might be applied to the development of novel strategies for the treatment and prevention of disease.