Microorganisms are integral to ecosystem functioning and host adaptation, yet the understanding of microbiomes in diverse beetle taxa remains limited. We conducted a comprehensive study to investigate the microbial composition of two red flat bark beetle species, Cucujus haematodes and C. cinnaberinus, and assessed the influence of host taxonomic relatedness and host tree species on their microbiomes. We sampled 67 larvae of two Cucujus taxa taken from 11 host tree species. 16S rRNA V4 fragment sequencing revealed distinct microbial communities associated with each Cucujus species, with host tree species significantly influencing microbiome composition. Alpha and beta diversity metrics indicated significant differences between microbial communities in both beetle and host tree species. Principal component analysis indicated distinct clustering based on host tree species but not for beetle species. This overlap could be attributed to the similar ecology of both Cucujus species. The detection of various bacteria, among which some have already been reported in saproxylophagous beetles, suggests that the red flat bark beetles ingest the bacteria via foraging on other wood-dwelling invertebrates. Our findings show the complex interplay between host taxonomy, microhabitat and microbial composition in Cucujus, providing insights into their ecological roles and conservation implications. This research helps to fill the gap in understanding the microbial dynamics of saproxylic beetles, sheds light on factors shaping their microbiomes and highlights the importance of considering both host species and environmental conditions when studying insect-microbe interactions in forest ecosystems.