Background: The aim of this study was to investigate the national prevalence of thyroid dysfunction in Spain and its association with various clinical, environmental, and demographic variables. Methods: The study included 4554 subjects (42.4% men) with a mean age of 50 years (range 18-93 years), who were participants in a national, cross-sectional, population-based survey conducted in 2009-2010. Data gathered included clinical and demographic characteristics, physical examination, and blood sampling. Thyrotropin, free thyroxine, free triiodothyronine, and thyroid peroxidase antibody (TPOAb) concentrations were analyzed by electrochemiluminescence. Urinary iodine (UI) levels were measured in an isolated urine sample. Results: The prevalence of treated hypothyroidism, untreated subclinical hypothyroidism, and untreated clinical hypothyroidism was 4.2% [confidence interval (CI) 3.6-4.9%], 4.6% [CI 4.0-5.2%], and 0.3% [CI 0.1-0.5%], respectively. The prevalence of total hypothyroidism (including all fractions) was 9.1% [CI 8.2-10.0%]. The prevalence of total hyperthyroidism was 0.8% [CI 0.6-1.1]. A total of 7.5% [CI 6.7-8.3%] of the population tested positive for TPOAbs (>= 50 IU/mL). In multivariate logistic regression models, TPOAbs were strongly associated with both hypothyroidism (p200 mu g/g creatinine) were associated with hypothyroidism (p < 0.001). The positive association between UI and hypothyroidism remained for both treated (p < 0.001) and untreated (p < 0.05) hypothyroidism, whereas it was especially significant for non-autoimmune (TPOAbs negative) forms (p= 200 mu g/g, there was a positive correlation between UI and thyrotropin levels (beta = 0.152, p < 0.001) and a negative correlation between UI and free triiodothyronine levels (beta=-0.134, p = 0.001). Conclusion: According to the data, a large proportion (10%) of the Spanish population has some evidence of thyroid dysfunction. High TPOAb concentrations were associated with both hypo- and hyperthyroidism, whereas high UI concentrations were associated with hypothyroidism.