The purpose of this study was to assess the hypothesis that pain and depression negatively impact the cognitive functioning of individuals with rheumatoid arthritis (RA). One hundred twenty-one community-dwelling RA patients (ages 34-84) completed a battery of cognitive tasks and multiple measures of pain and depression. Structural equation modeling techniques were used to assess the relative contributions of pain, depression, and age to cognitive performance. Individuals who performed poorly on cognitive tasks reported more pain and depression and were older than those individuals who performed well on cognitive tasks. Moreover, high levels of pain were associated with depression. Further analyses revealed that depression mediated the relationship between pain and cognition. That is, when depression was entered into the analyses, the previously significant effects of pain on cognition were no longer found. Interestingly, depression still mediated the pain-cognition relationship even after controlling for age. These findings suggest the importance of both pain and depression for understanding cognitive function in RA and may have important implications for treating this disease.