Brown-and-white giant pandas (hereafter brown pandas) are distinct coat color mutants found exclusively in the Qinling Mountains, Shaanxi, China. However, its genetic mechanism has remained unclear since their discovery in 1985. Here, we identified the genetic basis for this coat color variation using a combination of field ecological data, population genomic data, and a CRISPR-Cas9 knockout mouse model. We de novo assembled a long-read-based giant panda genome and resequenced the genomes of 35 giant pandas, including two brown pandas and two family trios associated with a brown panda. We identified a homozygous 25-bp deletion in the first exon of Bace2, a gene encoding amyloid precursor protein cleaving enzyme, as the most likely genetic basis for brown-and-white coat color. This deletion was further validated using PCR and Sanger sequencing of another 192 black giant pandas and CRISPR-Cas9 edited knockout mice. Our investigation revealed that this mutation reduced the number and size of melanosomes of the hairs in knockout mice and possibly in the brown panda, further leading to the hypopigmentation. These findings provide unique insights into the genetic basis of coat color variation in wild animals.