In Bacillus subtilis, although many genetic tools have been developed, gene replacement remains labour-intensive and not compatible with large-scale approaches. We have developed a new one-step gene replacement procedure that allows rapid alteration of any gene sequence or multiple gene sequences in B. subtilis without altering the chromosome in any other way. This novel approach relies on the use of upp, which encodes uracil phosphoribosyl-transferase, as a counter-selectable marker. We fused the upp gene to an antibiotic-resistance gene to create an 'upp-cassette'. A polymerase chain reaction (PCR)-generated fragment, consisting of the target gene with the desired mutation joined to the upp-cassette, was integrated into the chromosome by homologous recombination, using positive selection for antibiotic resistance. Then, the eviction of the upp-cassette from the chromosome by recombination between short repeated chromosomal sequences, included in the design of the transforming DNA molecule, was achieved by counter-selection of upp. This procedure was successfully used to deliver a point mutation, to generate in-frame deletions with reduced polar effects, and to combine deletions in three paralogous genes encoding two-component sensor kinases. Also, two chromosome regions carrying previously unrecognized essential functions were identified, and large deletions in two dispensable regions were combined. This work outlines a strategy for identifying essential functions that could be used at genome scale.