In mammals, interleukin 34 (IL-34) is a ligand for macrophage colony-stimulating factor receptor (M-CSFR), promoting inflammatory responses and inducing the synthesis and secretion of various cytokines. However, studies on its function in lower vertebrates is limited, and its evolutionary relationship with homologous molecules in mammals remains unclear. In this study, two IL-34-encoding genes were cloned and identified in common carp (Cyprinus carpio L.), designated as CcIL-34A and CcIL-34B, with an amino acid sequence similarity of 77.7%. Gene synteny analysis revealed that the IL-34 gene loci are relatively conserved, and both are located downstream of SF3B3. The expression patterns of CcIL-34s were analyzed using qRT-PCR, and this showed that they are expressed across all tested tissues, with higher levels in the liver, spleen, and head kidney and lower levels in the gills and intestines. Following infection with Aeromonas hydrophila, the mRNA expression levels of CcIL-34s in the gills, head kidney, intestines, and spleen were significantly upregulated. Immunofluorescence was also employed to assess changes in CcIL-34 protein expression, showing a significant increase in carp spleens 24 hours after A. hydrophila infection, suggesting that CcIL-34s contribute to host defense against this bacterium. To investigate the immunological function of IL-34 in vivo, pc-CcIL-34A and pc-CcIL-34B eukaryotic expression plasmids were constructed and injected intramuscularly into fish. Five days after injection, the expression levels of inflammation-related cytokines in the head kidney and spleen were significantly altered. Furthermore, 24 h post-A. hydrophila infection, the bacterial loads in the liver, spleen, and kidneys were significantly reduced. Ten days post-infection, the survival rates in the groups with CcIL-34A and CcIL-34B overexpression were 40% and 36.7%, respectively, compared to 16.7% in the control group. These findings suggest that CcIL-34s are involved in modulating inflammatory responses, enhancing the immune response, and improving survival rates in fish following bacterial infection, thus supporting the potential use of IL-34 molecules in aquaculture.