Proteins fluctuate between alternative conformations, which presents a challenge for ligand discovery because such flexibility is difficult to treat computationally owing to problems with conformational sampling and energy weighting. Here we describe a flexible docking method that samples and weights protein conformations using experimentally derived conformations as a guide. The crystallographically refined occupancies of these conformations, which are observable in an apo receptor structure, define energy penalties for docking. In a large prospective library screen, we identified new ligands that target specific receptor conformations of a cavity in cytochrome c peroxidase, and we confirm both ligand pose and associated receptor conformation predictions by crystallography. The inclusion of receptor flexibility led to ligands with new chemotypes and physical properties. By exploiting experimental measures of loop and side-chain flexibility, this method can be extended to the discovery of new ligands for hundreds of targets in the Protein Data Bank for which similar experimental information is available.