Background Of the Swedish people with advanced dementia, the majority die in nursing homes. Unresolved pain can occur in people with a terminal illness such as dementia. However, pain management in people with advanced dementia is often suboptimal and inadequate, with fewer palliative care interventions than offered to cancer patients. Although they are largely responsible for the care of these people, few studies have addressed the experiences of registered nurses in this respect. Therefore, the aim of this study was to describe the experiences of nurses in caring for people with advanced dementia and pain at the end of life. Methods The study had a descriptive explorative design. Individual qualitative, semi-structured interviews were carried out with 13 nurses from 12 nursing homes in Sweden. The results were analysed using thematic content analysis. Results The nurses described communicative, relational and organisational challenges. One major issue involved difficulties communicating with the person with advanced dementia, resulting in uncertain pain assessment. Other difficulties involved the differentiation of pain from anxiety, the balance of benefits and risks with morphine administration, and the creation of good relationships with healthcare personnel and the persons’ relatives. Relatives can greatly affect the assessment and management of pain, both because of their ability to interpret pain behaviour and by questioning the care given. Good pain management was facilitated by good communication and relationships with healthcare staff and relatives, extensive professional nursing experience, and already knowing the person with advanced dementia. Conclusions This study highlights the need for nursing homes to employ specialist nurses who have been trained in the appropriate knowledge and skills to deal with the challenges of end-of-life care for people with advanced dementia and pain. Additionally, there should be resources and strategies available for providing information to family members and for involving them in the decision-making process, as they are often unfamiliar with the multitude of considerations involved in decisions such as whether to administer morphine or not.