An optimal approach to magnetic resonance imaging fusion targeted prostate biopsy (PBx) remains unclear (number of cores, intercore distance, Gleason grading [GG] principle). The aim of this study was to develop a precise pixel-wise segmentation diagnostic artificial intelligence (AI) algorithm for tumor detection and GG as well as an algorithm for virtual prostate biopsy that are used together to systematically investigate and find an optimal approach to targeted PBx. Pixel-wise AI algorithms for tumor detection and GG were developed using a high-quality, manually annotated data set (slides n = 442) after fast-track annotation transfer into segmentation style. To this end, a virtual biopsy algorithm was developed that can perform random biopsies from tumor regions in whole-mount whole-slide images with predefined parameters. A cohort of 115 radical prostatectomy (RP) patient cases with clinically significant, magnetic resonance imaging-visible tumors (n = 121) was used for systematic studies of the optimal biopsy approach. Three expert genitourinary (GU) pathologists participated in the validation. The tumor detection algorithm (aware version sensitivity/specificity 0.99/0.90, balanced version 0.97/0.97) and GG algorithm (quadratic kappa range vs pathologists 0.77-0.78) perform on par with expert GU pathologists. In total, 65,340 virtual biopsies were performed to study different biopsy approaches with the following results: (1) 4 biopsy cores is the optimal number for a targeted PBx, (2) cumulative GG strategy is superior to using maximal Gleason score for single cores, (3) controlling for minimal intercore distance does not improve the predictive accuracy for the RP Gleason score, (4) using tertiary Gleason pattern principle (for AI tool) in cumulative GG strategy might allow better predictions of final RP Gleason score. The AI algorithm (based on cumulative GG strategy) predicted the RP Gleason score of the tumor better than 2 of the 3 expert GU pathologists. In this study, using an original approach of virtual prostate biopsy on the real cohort of patient cases, we find the optimal approach to the biopsy procedure and the subsequent GG of a targeted PBx. We publicly release 2 large data sets with associated expert pathologists’ GG and our virtual biopsy algorithm.