Eighty-five Icelandic children (41 girls and 44 boys) participated in a study on the relations among attachment representations, self-confidence, and cognitive functioning in childhood and adolescence. Attachment representations and self-confidence were assessed at age 7 on the basis of children's responses to a separation story and observations made by independent observers. Cognitive functioning was measured at ages 7, 9, 12, 15, and 17 years based on a battery of Piagetian tasks assessing concrete and formal reasoning. Children with a secure attachment representation were favored in their cognitive performance in childhood and adolescence. Children with an insecure–disorganized attachment representation were particularly disadvantaged on deductive reasoning tasks. Self-confidence played a significant but varying role in mediating the effects of attachment representations on cognitive functioning. The study controlled for IQ and attention difficulties.