Gene replacement by homologous recombination is a powerful tool for fundamental studies of gene function, as well as allowing specific attenuation of pathogens, but has proved difficult to achieve for Mycobacterium tuberculosis. We have used a plasmid-based test system to demonstrate the occurrence of homologous recombination in the tuberculosis vaccine strain Mycobacterium bovis BCG, and we have successfully replaced a target gene in BCG by homologous recombination, using a shuttle plasmid. Specific inactivation of selected genes will facilitate study of virulence factors and drug resistance as well as allowing rational attenuation of M. tuberculosis for the production of new vaccines.