Streblide flies are obligatory ectoparasites with a worldwide distribution, specialized in exclusively parasitizing bats, which serve as important reservoirs of Bartonella spp. These flies are considered potential vectors of emerging Bartonella species. Despite the high diversity of both bats and streblid flies in Brazil, little is known about the occurrence and genetic diversity of Bartonella spp. in these hosts, particularly in cave environments. This study investigated the occurrence and genetic diversity of Bartonella spp. in streblid flies associated with bats from humid forest remnants in Pernambuco state (558 flies from 12 species collected from 299 bats) and from caves in Pará state (677 flies from 11 species collected from 174 bats). Fly DNA samples positive for the endogenous cox-1 gene were screened by qPCR targeting the intergenic region 16S-23S rRNA of Bartonella spp., followed by molecular characterization using five genetic markers (gltA, rpoB, ribC, pap-31, and ftsZ). The overall positivity rates for Bartonella spp. were 37.5 % in Pernambuco and 25.4 % in Pará. Although molecular detection was achieved in both regions, successful genetic characterization was only possible for flies collected from cave-dwelling bats in the Brazilian Amazon. These analyses revealed a high genetic diversity of Bartonella spp., with the identification of 11 gltA genotypes, six ftsZ genotypes, and four rpoB genotypes. Phylogenetic inferences based on these three markers demonstrated close relationships between the sequences detected in this study and genotypes previously reported in bats and bat flies from Brazil and other countries. This study provides the first molecular evidence of Bartonella spp. in streblid flies parasitizing cave-dwelling bats in Brazil, highlighting new perspectives for interspecific interaction studies (Bartonella-fly-bat) in these understudied ecosystems. Furthermore, this work reports, for the first time in Pará state, Bartonella spp. in Nycterophilia parnelli, Trichobius galei, Mastoptera minuta, and Trichobius johnsonae.