Niemann-Pick C1 (NPC1), a lysosomal protein of 13 transmembrane helices (TMs) and three lumenal domains, exports low-density-lipoprotein (LDL)-derived cholesterol from lysosomes. TMs 3-7 of NPC1 comprise the Sterol-Sensing Domain (SSD). Previous studies suggest that mutation of the NPC1-SSD or the addition of the anti-fungal drug itraconazole abolishes NPC1 activity in cells. However, the itraconazole binding site and the mechanism of NPC1-mediated cholesterol transport remain unknown. Here, we report a cryo-EM structure of human NPC1 bound to itraconazole, which reveals how this binding site in the center of NPC1 blocks a putative lumenal tunnel linked to the SSD. Functional assays confirm that blocking this tunnel abolishes NPC1-mediated cholesterol egress. Intriguingly, the palmitate anchor of Hedgehog occupies a similar site in the homologous tunnel of Patched, suggesting a conserved mechanism for sterol transport in this family of proteins and establishing a central function of their SSDs.