Background: Osteoporosis is diagnosed by the measurement of bone mineral density, which is a highly heritable and multifactorial trait. We aimed to identify genetic loci that are associated with bone mineral density. Methods: In this genome-wide association study, we identified the most promising of 314 075 single nucleotide polymorphisms (SNPs) in 2094 women in a UK study. We then tested these SNPs for replication in 6463 people from three other cohorts in western Europe. We also investigated allelic expression in lymphoblast cell lines. We tested the association between the replicated SNPs and osteoporotic fractures with data from two studies. Findings: We identified genome-wide evidence for an association between bone mineral density and two SNPs (p<5×10-8). The SNPs were rs4355801, on chromosome 8, near to the TNFRSF11B (osteoprotegerin) gene, and rs3736228, on chromosome 11 in the LRP5 (lipoprotein-receptor-related protein) gene. A non-synonymous SNP in the LRP5 gene was associated with decreased bone mineral density (rs3736228, p=6·3×10-12for lumbar spine and p=1·9×10-4for femoral neck) and an increased risk of both osteoporotic fractures (odds ratio [OR] 1·3, 95% CI 1·09-1·52, p=0·002) and osteoporosis (OR 1·3, 1·08-1·63, p=0·008). Three SNPs near the TNFRSF11B gene were associated with decreased bone mineral density (top SNP, rs4355801: p=7·6×10-10for lumbar spine and p=3·3×10-8for femoral neck) and increased risk of osteoporosis (OR 1·2, 95% CI 1·01-1·42, p=0·038). For carriers of the risk allele at rs4355801, expression of TNFRSF11B in lymphoblast cell lines was halved (p=3·0×10-6). 1883 (22%) of 8557 people were at least heterozygous for these risk alleles, and these alleles had a cumulative association with bone mineral density (trend p=2·3×10-17). The presence of both risk alleles increased the risk of osteoporotic fractures (OR 1·3, 1·08-1·63, p=0·006) and this effect was independent of bone mineral density. Interpretation: Two gene variants of key biological proteins increase the risk of osteoporosis and osteoporotic fracture. The combined effect of these risk alleles on fractures is similar to that of most well-replicated environmental risk factors, and they are present in more than one in five white people, suggesting a potential role in screening. Funding: Wellcome Trust, European Commission, NWO Investments, Arthritis Research Campaign, Chronic Disease Research Foundation, Canadian Institutes of Health Research, European Society for Clinical and Economic Aspects of Osteoporosis, Genome Canada, Genome Quebéc, Canada Research Chairs, National Health and Medical Research Council of Australia, and European Union.