Heterogeneity of prostate cancer (PCa) contributes to inaccurate cancer screening and diagnosis, unnecessary biopsies, and overtreatment. We intended to develop non-invasive urine tests for accurate PCa diagnosis to avoid unnecessary biopsies.Using a machine learning program, we identified a 25-Gene Panel classifier for distinguishing PCa and benign prostate. A non-invasive test using pre-biopsy urine samples collected without digital rectal examination (DRE) was used to measure gene expression of the panel using cDNA preamplification followed by real-time qRT-PCR. The 25-Gene Panel urine test was validated in independent multi-center retrospective and prospective studies. The diagnostic performance of the test was assessed against the pathological diagnosis from biopsy by discriminant analysis. Uni- and multivariate logistic regression analysis was performed to assess its diagnostic improvement over PSA and risk factors. In addition, the 25-Gene Panel urine test was used to identify clinically significant PCa. Furthermore, the 25-Gene Panel urine test was assessed in a subset of patients to examine if cancer was detected after prostatectomy.The 25-Gene Panel urine test accurately detected cancer and benign prostate with AUC of 0.946 (95% CI 0.963-0.929) in the retrospective cohort (n = 614), AUC of 0.901 (0.929-0.873) in the prospective cohort (n = 396), and AUC of 0.936 (0.956-0.916) in the large combination cohort (n = 1010). It greatly improved diagnostic accuracy over PSA and risk factors (p < 0.0001). When it was combined with PSA, the AUC increased to 0.961 (0.980-0.942). Importantly, the 25-Gene Panel urine test was able to accurately identify clinically significant and insignificant PCa with AUC of 0.928 (95% CI 0.947-0.909) in the combination cohort (n = 727). In addition, it was able to show the absence of cancer after prostatectomy with high accuracy.The 25-Gene Panel urine test is the first highly accurate and non-invasive liquid biopsy method without DRE for PCa diagnosis. In clinical practice, it may be used for identifying patients in need of biopsy for cancer diagnosis and patients with clinically significant cancer for immediate treatment, and potentially assisting cancer treatment follow-up.