Termites are social insects that live in the soil or in decaying wood, where exposure to pathogens should be common. However, these pathogens rarely cause mortality in established colonies. In addition to social immunity, the gut symbionts of termites are expected to assist in protecting their hosts, though the specific contributions are unclear. In this study, we examined this hypothesis in Odontotermes formosanus, a fungus-growing termite in the family Termitidae, by 1) disrupting its gut microbiota with the antibiotic kanamycin, 2) challenging O. formosanus with the entomopathogenic fungus Metarhizium robertsii, and finally 3) sequencing the resultant gut transcriptomes. As a result, 142531 transcripts and 73608 unigenes were obtained, and unigenes were annotated following NR, NT, KO, Swiss-Prot, PFAM, GO, and KOG databases. Among them, a total of 3,814 differentially expressed genes (DEGs) were identified between M. robertsii infected termites with or without antibiotics treatment. Given the lack of annotated genes in O. formosanus transcriptomes, we examined the expression profiles of the top 20 most significantly differentially expressed genes using qRT-PCR. Several of these genes, including APOA2, Calpain-5, and Hsp70, were downregulated in termites exposed to both antibiotics and pathogen but upregulated in those exposed only to the pathogen, suggesting that gut microbiota might buffer/facilitate their hosts against infection by finetuning physiological and biochemical processes, including innate immunity, protein folding, and ATP synthesis. Overall, our combined results imply that stabilization of gut microbiota can assist termites in maintaining physiological and biochemical homeostasis when foreign pathogenic fungi invade.