According to the findings of multiple observational studies, immune disorder was a risk factor for prostatitis. However, it remained unknown whether there was a direct causal relationship between immune cells and prostatitis or whether this relationship was mediated by plasma metabolites. Based on the pooled data of a genome-wide association study (GWAS), a genetic variant was used to predict the effects of 731 immunophenotypes on the risk of prostatitis and determine whether the effects were mediated by 1400 metabolites. The bidirectional 2-sample Mendelian randomization (MR) method was adopted to uncover the causal relationship between immunophenotypes and prostatitis. Subsequently, a 2-step MR method was employed to evaluate whether the metabolites mediated this causal relationship and quantify the mediating effects and the corresponding ratios. In addition, the Bayesian-weighted Mendelian randomization (BWMR) method was employed to verify the results. Among the 731 immunophenotypes analyzed, 16 had causal relationships with the risk of prostatitis, including 11 with positive correlations (P < .05, beta > 0) and 5 with negative correlations (P < .05, beta < 0). The MR analysis screened out 9 metabolites related to the risk of prostatitis. The X - 24344 levels mediated the causal relationship between CD3 on CD39+ activated Treg and prostatitis (mediation effect: 0.01; ratio: 9.82%). Both histidine betaine (hercynine) levels and the proline-to-glutamate ratio mediated the causal relationship between CD14-CD16+ monocyte absolute count and prostatitis, with the mediation effects of -0.016 (14.20%) and -0.008 (7.24%), respectively. The glutamine degradant levels mediated the causal relationship between HLA DR+ CD4+ %T cells and prostatitis, with a mediation effect of -0.012, accounting for 8.07% of the total. The present study indicated that the immune cell subsets predicted based on gene expression profiles were potentially beneficial or harmful risk factors of prostatitis, and plasma metabolites may serve as the mediating factors of the relationship. The study thus shed light on deciphering the immunologic mechanism of prostatitis., Competing Interests: The authors have no conflicts of interest to disclose., (Copyright © 2024 the Author(s). Published by Wolters Kluwer Health, Inc.)