The molting-inhibiting hormones (MIHs) from the crustacean hyperglycemic hormone (CHH) family are a group of neuropeptides that are implicated in regulation of molting and reproduction in crustaceans. In this study, a novel protein containing a typical crustacean neuropeptide domain was identified from Litopenaeus vannamei. The protein showed high homology with other shrimp MIHs and was then designated as a MIH-like protein (MIHL). Among the detected tissues, the heart expressed the highest level of MIHL. The expression of MIHL could be significantly up-regulated after infection with white spot syndrome virus (WSSV), gram-negative bacterium Vibro parahaemolyticus and gram-positive bacterium Staphylococcus aureus, indicating that MIHL could be involved in immune responses. The promoter of MIHL was predicted to contain two NF-κB binding sites and could be regulated by the NF-κB family protein Relish but not Dorsal, suggesting that MIHL could be an effector gene of the IMD/Relish pathway. Silencing of MIHL in vivo by RNAi strategy significantly down-regulated the expression of many immune effector genes and increased the mortalities of shrimp infected by V. parahaemolyticus and WSSV and their copy numbers in tissues. These confirmed that MIHL could play a role in antiviral and antibacterial immune responses in shrimp.