Oyster mushrooms have a high biological efficiency and are easy to cultivate, which is why they are produced all over the world. Cap color is an important commercial trait for oyster mushrooms. Little is known about the genetic mechanism of the cap color trait in oyster mushrooms, which limits molecular breeding for the improvement of cap color-type cultivars. In this study, a 0.8-Mb major quantitative trait locus (QTL) region controlling cap color in the oyster mushroom Pleurotus cornucopiae was mapped on chromosome 7 through bulked-segregant analysis sequencing (BSA-seq) and extreme-phenotype genome-wide association studies (XP-GWAS). Candidate genes were further selected by comparative transcriptome analysis, and a tyrosinase gene (PcTYR) was identified as the highest-confidence candidate gene. Overexpression of PcTYR resulted in a significantly darker cap color, while the cap color of RNA interference (RNAi) strains for this gene was significantly lighter than that of the wild-type (WT) strains, suggesting that PcTYR plays an essential role in cap color formation. This is the first report about fine mapping and functional verification of a gene controlling cap color in oyster mushrooms. This will enhance our understanding of the genetic basis for cap color formation in oyster mushrooms and will facilitate molecular breeding for cap color. IMPORTANCE Oyster mushrooms are widely cultivated and consumed over the world for their easy cultivation and high biological efficiency (mushroom fresh weight/substrate dry weight × 100%). Fruiting bodies with dark caps are more and more popular according to consumer preferences, but dark varieties are rarely seen on the market. Little is known about the genetic mechanism of the cap color trait in oyster mushrooms, which limits molecular breeding for the improvement of cap color-type cultivars. A major QTL of cap color in oyster mushroom P. cornucopiae was fine mapped by using bulked-segregant analysis (BSA) and extreme-phenotype genome-wide association study (XP-GWAS) analysis. A candidate gene PcTYR coding tyrosinase was further identified with the help of comparative transcriptome analysis. qPCR analysis and genetic transformation tests proved that PcTYR played an essential role in cap color formation. This study will contribute to revealing the genetic mechanism of cap color formation in mushrooms, thereby facilitating molecular breeding for cap color trait.