Although gut microbes are regarded as a significant component of many mammals and play a very important role, there is a paucity of knowledge around marine mammal gut microbes, which may be due to sampling difficulties. Moreover, to date, there are very few, if any, reports on the gut microbes of melon-headed whales. In this study, we opportunistically collected fecal samples from eight stranded melon-headed whales (Peponocephala electra) in China. Using high-throughput sequencing technology of partial 16S rRNA gene sequences, we demonstrate that the main taxa of melon-headed whale gut microbes are Firmicutes, Fusobacteriota, Bacteroidota, and Proteobacteria (Gamma) at the phylum taxonomic level, and Cetobacterium, Bacteroides, Clostridium sensu stricto, and Enterococcus at the genus taxonomic level. Meanwhile, molecular ecological network analysis (MENA) shows that two modules (a set of nodes that have strong interactions) constitute the gut microbial community network of melon-headed whales. Module 1 is mainly composed of Bacteroides, while Module 2 comprises Cetobacterium and Enterococcus, and the network keystone genera are Corynebacterium, Alcaligenes, Acinetobacter, and Flavobacterium. Furthermore, by predicting the functions of the gut microbial community through PICRUSt2, we found that although there are differences in the composition of the gut microbial community in different individuals, the predicted functional profiles are similar. Our study gives a preliminary inside look into the composition of the gut microbiota of stranded melon-headed whales.