The relationship between pain and cognitive dysfunction was explained by sleep disturbance and depressive symptoms.