Myrmecomorphy is the most common type of Batesian mimicry in arthropods. In the true bugs (Insecta: Hemiptera: Heteroptera), myrmecomorphy has been recorded in at least seven superfamilies, but not among the stink bugs (Pentatomoidea) until 2014. The only known species that exhibits a high degree of myrmecomorphy during both the adult and nymphal stages within this group, Pentamyrmex spinosus, was reported based on a single specimen, yet little was known beyond its morphological description. In this study, the biology of this species is reported as living in bamboo (Poaceae: Bambusoideae), in close proximity with a highly similar ant species, Polyrhachis dives (Hymenoptera: Formicidae). Further, the phylogenetic position and the origin time of this stink bug species were inferred in the context of Pentatomoidea. The dated phylogeny indicates that Pentamyrmex spinosus is the sister group of Phyllocephalinae, a specialized grass‐feeding subfamily in Pentatomidae, and diverged about 42.7 Ma (52.6–33.2 Ma), roughly synchronous with the radiation of the crown group of Polyrhachis ants (42.0–33.0 Ma) and slightly after the early radiation of bamboos (66.9–24.9 Ma). Our results suggest that the origin of this myrmecomorphic stink bug was probably driven by the rapid diversification of spiny ants and bamboo. In addition, our results also provide a reference framework for the phylogenetic and taxonomic systems of Pentatomoidea and Pentatomidae.