We performed a genome-wide association scan to search for sequence variants conferring risk of prostate cancer using 1,501 Icelandic men with prostate cancer and 11,290 controls. Follow-up studies involving three additional case-control groups replicated an association of two variants on chromosome 17 with the disease. These two variants, 33 Mb apart, fall within a region previously implicated by family-based linkage studies on prostate cancer. The risks conferred by these variants are moderate individually (allele odds ratio of about 1.20), but because they are common, their joint population attributable risk is substantial. One of the variants is in TCF2 (HNF1beta), a gene known to be mutated in individuals with maturity-onset diabetes of the young type 5. Results from eight case-control groups, including one West African and one Chinese, demonstrate that this variant confers protection against type 2 diabetes.