Human epididymitis is mainly caused by retrograde urinary tract infection with uropathogenic Escherichia coli (UPEC). This disease is an important factor (accounting for 20–30%) causing male infertility. C-type natriuretic peptide (CNP), a protein composed of 22 amino acids, is proved to play an immunoregulatory role in respiratory and cardiovascular systems. CNP is expressed extremely high in the epididymis, but whether CNP plays the same role in acute epididymitis is unclear. At first, we established an acute caput epididymitis model in rats with UPEC and treated them with CNP to measure inflammatory damage. Then RNA-seq transcriptome technology was used to reveal potential signal pathways. Secondly, the turbidity and activity of UPEC were assessed using a microplate reader and the amount of UPEC by agar plates after incubation with CNP. Thirdly, macrophages in caput epididymis were tested by immunohistochemistry (IHC). Meanwhile, lipopolysaccharide (LPS) with or without CNP was used to stimulate the macrophage (RAW264.7) in vitro and to detect the expression level of pro-inflammatory factors. Finally, the macrophage (RAW264.7) was treated with CNP, 8-Br-cGMP [cyclic guanosinc monophosphate (cGMP) analog] and KT5823 [protein kinase G (PKG) inhibitor], and the expression level of nuclear factor-k-gene binding (NF-kB) signal pathway was examined. The results showed that the damage of epididymis induced by UPEC as well as the pro-inflammatory factors could be alleviated significantly with CNP treatment. CNP could inhibit the activity and numbers of bacteria in both in vivo and in vitro experiments. Moreover, CNP repressed the invasion, and the expression of pro-inflammatory factors (such as NF-kB, IL-1β, IL-6, TNF-α) in macrophages and its effect could be inhibited by KT5823. Therefore, we drew a conclusion from the above experiments that CNP alleviates the acute epididymitis injury induced by UPEC. On one hand, CNP could inhibit the growth of UPEC. On the other hand, CNP could decrease invasion and inflammatory reaction of macrophages; the mechanism was involved in inhibiting NF-kB signal pathway through the cGMP/PKG in macrophages. This research would open up the possibility of using CNP as a potential treatment for epididymitis.