Sex steroids are important physiologic regulators of bone mass, and genes regulating sex steroid production and metabolism are obvious as candidate genes for osteoporosis susceptibility. We present data from a study of 1795 recent postmenopausal women, assigned to either hormone replacement therapy (HRT) or no treatment and followed for 5 years. The association between bone mass measurements and two single nucleotide polymorphisms, a T (A1) to C (A2) transition in the 5′-UTR of the cytochrome P450c17α (CYP17) gene and a G (Val) to A (Met) transition in exon 4 of the catechol-O-methyltransferase (COMT) gene, was evaluated. Association with CYP17 genotype was modified by body mass index (BMI). In lean women, individuals homozygous for the CYP17 A2 allele were 1 cm shorter and had lower baseline BMD (bone mineral density), BMC, and CSA (cross sectional area) in the spine and femoral neck than did other women (BMD spine A2A2: 0.975 g/cm2 versus 1.011 g/cm2 in A1A1 + A1A2, P = 0.002). Conversely, an adverse association with A2A2 and bone loss over 5 years seemed present only in overweight women, but differences were small. Response to HRT was not dependent on CYP17 genotype. COMT genotype was not associated with bone mass at baseline, bone loss in untreated women, or response to HRT. In conclusion, the A2 allele of the CYP17 T27-C polymorphism is associated with reduced bone mass and bone size in lean perimenopausal women, whereas high BMI protects against this negative association. The COMT G1947-A polymorphism is not associated with bone parameters in this study.