CYP164 family P450 enzymes are found in only a subset of mycobacteria and include CYP164A1, which is the sole P450 found in Mycobacterium leprae, the causative agent of leprosy. This has previously led to interest in this enzyme as a potential drug target. Here we describe the first crystal structure of a CYP164 enzyme, CYP164A2 from Mycobacterium smegmatis. CYP164A2 has a distinctive, enlarged hydrophobic active site that extends above the porphyrin ring toward the access channels. Unusually, we find that CYP164A2 can simultaneously bind two econazole molecules in different regions of the enlarged active site and is accompanied by the rearrangement and ordering of the BC loop. The primary location is through a classic interaction of the azole group with the porphyrin iron. The second econazole molecule is bound to a unique site and is linked to a tetracoordinated metal ion complexed to one of the heme carboxylates and to the side chains of His 105 and His 364. All of these features are preserved in the closely homologous M. leprae CYP164A1. The computational docking of azole compounds to a homology model of CYP164A1 suggests that these compounds will form effective inhibitors and is supported by the correlation of parallel docking with experimental binding studies of CYP164A2. The binding of econazole to CYP164A2 occurs primarily through the high-spin "open" conformation of the enzyme (K-d[dissociation constant] of 0.1 mu M), with binding to the low-spin "closed" form being significantly hindered (K-d of 338 mu M). These studies support previous suggestions that azole derivatives may provide an effective strategy to improve the treatment of leprosy.