By combining genomics and isotope imaging analysis using high-resolution secondary ion mass spectrometry (NanoSIMS), we examined the function and evolution of Bacteroidales ectosymbionts of the protist Barbulanympha from the hindguts of the wood-eating cockroach Cryptocercus punctulatus In particular, we investigated the structure of ectosymbiont genomes, which, in contrast to those of endosymbionts, has been little studied to date, and tested the hypothesis that these ectosymbionts fix nitrogen. Unlike with most obligate endosymbionts, genome reduction has not played a major role in the evolution of the Barbulanympha ectosymbionts. Instead, interaction with the external environment has remained important for this symbiont as genes for synthesis of transporters, outer membrane proteins, lipopolysaccharides, and lipoproteins have been retained. The ectosymbiont genome carried two complete operons for nitrogen fixation, a urea transporter, and a urease, indicating the availability of nitrogen as a driving force behind the symbiosis. NanoSIMS analysis of C. punctulatus hindgut symbionts exposed in vivo to (15)N2 supports the hypothesis that Barbulanympha ectosymbionts are capable of nitrogen fixation. This genomic and in vivo functional investigation of protist ectosymbionts highlights the diversity of evolutionary forces and trajectories that shape symbiotic interactions. The ecological and evolutionary importance of symbioses is increasingly clear, but the overall diversity of symbiotic interactions remains poorly explored. In this study, we investigated the evolution and nitrogen fixation capabilities of ectosymbionts attached to the protist Barbulanympha from the hindgut of the wood-eating cockroach Cryptocercus punctulatus In addressing genome evolution of protist ectosymbionts, our data suggest that the ecological pressures influencing the evolution of extracellular symbionts clearly differ from intracellular symbionts and organelles. Using NanoSIMS analysis, we also obtained direct imaging evidence of a specific hindgut microbe playing a role in nitrogen fixation. These results demonstrate the power of combining NanoSIMS and genomics tools for investigating the biology of uncultivable microbes. This investigation paves the way for a more precise understanding of microbial interactions in the hindguts of wood-eating insects and further exploration of the diversity and ecological significance of symbiosis between microbes.