In the present study, the sexual dimorphism in immune response in the seahorse Hippocampus erectus in which males compete for mates and invest heavily in parental care was assessed. Variability in immunocompetence in virginal seahorses with differing levels of sexual maturity (i.e., immaturity, early maturity and maturity) and with different mating statuses (i.e., virginal, experienced mating failure and experienced mating success) were analyzed by evaluating immune parameters in the plasma. Additionally, ultrastructural characteristics of the inner epithelium of the brood pouch were compared between males that had experienced mating failure and those that had succeeded. Generally, immunity in sexually mature virgin males was greater than in females, and mating competition significantly reduced males' immunity. However, parental care gave males stronger immune and metabolic abilities and resulted in their immunity significantly rebounding after a successful mating. The present study quantitatively clarifies, for the first time, how parental care and mating competition jointly affect immunity. Moreover, previous findings that females display more efficient immune defenses than males in conventional species (i.e., males are as competitor and females as care giver) and that males' immunity is higher than females' in the pipefish (i.e., females are as competitor and males as care giver) in combination with the present results indicate that parental care is a key factor for sexual dimorphism in immunity. The care-giving sex has strong immunity regardless of the sex in charge of mating competition or not.