We investigated whether wingless sexuals of the ant Hypoponera opacior adjust mate-guarding behaviour to the level of competition in the nest. Males mate with young nestmate females shortly before these emerge from the cocoon. Aggressive interactions among adult males have never been observed, but males embrace and guard the cocoons of their mating partners for up to 2 days. In laboratory experiments, the duration of pupal guarding increased with the number of adult males in the nest, but decreased with an increasing number of mating partners per male. These findings demonstrate that males are aware of the competitive situation in the nest and adjust their mating behaviour in an adaptive manner. Males also guarded and attempted to copulate with sterile worker and male pupae. These misdirected behaviours might be the result of identification errors, as we found that the cuticular hydrocarbon profiles of young individuals of the different castes were very similar. Copulatory behaviour towards sterile workers is certainly maladaptive, whereas interactions with young males may provide a fitness benefit: We found a high mortality rate of young males that were embraced and guarded by adult males. Adult male–male pupae interactions predominantly occurred when only a single male was present in the nest. In addition, single-male nests were found at unusually high frequencies. These findings suggest that wingless males try to kill their pupal rivals through embracing when there are few adult competitors in the nest, but switch to mate-guarding behaviour when intramale competition is high.