The relationship of cognitive function and pain to depression was studied among 195 participants in senior daycare centers and 408 residents of a nursing home. The residents' cognitive capacity was segregated into three levels (intact, moderate impairment and severe impairment) as determined by the Brief Cognitive Rating Scale (BCRS). Ratings of both the residents' levels of depressed affect, as well as whether they experienced any pain were obtained from the staff at each institution. In both populations, individuals in pain with moderate cognitive impairment evinced the highest levels of depressed affect. The present findings indicate that moderate cognitive impairment might exacerbate the impact of pain on depressed affect. The importance of detecting physical pain and depressed affect among those suffering with dementia is therefore underscored.