Statistical tests for detecting mosaic structure or recombination among nucleotide sequences usually rely on identifying a pattern or a signal that would be unlikely to appear under clonal reproduction. Dozens of such tests have been described, but many are hampered by long running times, confounding of selection and recombination, and/or inability to isolate the mosaic-producing event. We introduce a test that is exact, nonparametric, rapidly computable, free of the infinite-sites assumption, able to distinguish between recombination and variation in mutation/fixation rates, and able to identify the breakpoints and sequences involved in the mosaic-producing event. Our test considers three sequences at a time: two parent sequences that may have recombined, with one or two breakpoints, to form the third sequence (the child sequence). Excess similarity of the child sequence to a candidate recombinant of the parents is a sign of recombination; we take the maximum value of this excess similarity as our test statistic D m,n,b . We present a method for rapidly calculating the distribution of D m,n,b and demonstrate that it has comparable power to and a much improved running time over previous methods, especially in detecting recombination in large data sets. M OSAIC structure exists in a nucleotide sequence if different segments of the sequence descend from different ancestors. A nucleotide sequence can be a mosaic of other sequences as a result of recombination or gene conversion; mosaic structure in bacterial DNA can also result from transduction, transformation, or conjugation, which are collectively referred to as horizontal gene transfer. The detection of mosaic structure has received much attention over the past two decades as a result of both a proliferation of sequence data and leaps in computing power, which together have allowed for the inference of multiple ancestral contributions to a nucleotide sequence. The biological questions at the source of this recent attention range from interest in the evolution of pathogens (Awadalla 2003;Moya et al. 2004;Wilson et al. 2005) and the characterization of linkage disequilibrium in large genomes (Pritchard and Przeworski 2001;Ardlie et al. 2002;Gabriel et al. 2002) to theoretical questions about clonality and the definitions of clonal and nearly clonal organisms (Maynard Smith et al. 1993;Halkett et al. 2005). For reviews on the methods and results in this field, see Posada et al. (2002) and Stumpf and McVean (2003).Maynard recognized that the continuum between completely clonal and freely recombining organisms naturally gives rise to two distinct problems: determining whether recombination occurs and measuring its frequency. In this investigation, we focus on the former. Detecting recombination usually involves searching groups of sequences for candidate recombinants or recombination signals and testing whether these represent statistically significant departures from expectation under a null hypothesis of no recombination. Dozens of statistical tests have ...