Social networks predict longevity across societies but specific mechanisms are largely unknown. The aim of this work was to examine the role of children in the longevity of elderly men and women in a cohort of community dwelling elderly people in Spain. The data were taken from the "Aging in Leganes" cohort study with 15 years of follow-up. The baseline population was an age- and sex-stratified random sample of community dwelling people over 65 living in Leganés (Madrid) in 1993. Poor relationship with at least one child, emotional support and the perceived roles elders play in the lives of their children, extended family, spouse and friends were assessed at baseline. Cox proportional hazards models were fit to investigate the effects of social roles variables on longevity, adjusting for a wide range of socioeconomic, behavioural and health covariates. In the fully adjusted model, having a poor relationship with at least one child increased mortality by 30%. Elderly persons who felt their role in their children's lives was important (HR = 0.70; 95% CI 0.54; 0.91) had a lower mortality risk than those who felt they played a small role. Feeling loved and listened to by one's children did not have an effect on survival. Maintaining an important role in the extended family was also significantly associated with survival. In this Mediterranean population, maintaining an important role in the lives of one's children is associated with survival. Functions of social networks related to meaning of life and different forms of social support may have important effects on mortality, and these functions may vary across cultures according to family norms and values.