Bacterial population genomic analyses rely on identification of genetic recombinations, but growing databases represent a challenge for computational methods to detect these recombinations and interpret sequence ancestry. We introduce a novel algorithm called fastGEAR which identifies major lineages in diverse microbial alignments and recombinations between them. The algorithm can detect not only recent recombinations, but also the ancestral ones affecting entire lineages. Using simulated data, fastGEAR demonstrates outstanding power to detect ancestral recombination events compared to other state-of-the-art methods. The utility is further demonstrated by analysing 616 whole genomes of Streptococcus pneumoniae, providing novel insights into the evolution of recombinogenic bacteria.