Many granivorous farmland birds in the UK have declined substantially since the 1970s, coinciding with widespread agricultural intensification. The population trend of the Yellowhammer is, however, unique, since after a long period of stability it started to decline in the late 1980s. This study quantifies Yellowhammer habitat associations on British farmland before and during the decline (1988 and 1993), using Common Birds Census (CBC) data from the British Trust for Ornithology. In both years, variation in Yellowhammer densities between farmland CBC plots was strongly correlated with three main habitat parameters. Yellowhammer density increased with the proportion of the plot area growing cereals, and with crop diversity and hedgerow length, and was highest at intermediate altitudes. Farms dominated by grass and non-cereal crops, and those lacking cereals were most likely to lose territories between 1988 and 1993. These results suggest that there may be a critical availability of cereal cultivation below which Yellowhammer populations cannot persist, which may explain the recent pattern of range contraction in the pastoral north and west of the British Isles. They do not, however, explain the recent population decline recorded by the CBC in southern and eastern Britain, where cereal cultivation is predominant. This decline is probably not a direct consequence of summer land-use change, and requires further investigation.