In preterm infants, insecure attachment is associated with behavioural and emotional problems but data on attachment beyond toddler age are scarce. This study assessed attachment security at 6-8 years in very and moderate or late preterm infants. The results were compared to a non-clinical full-term sample. Attachment security of 38 very and 20 moderate or late preterm infants was assessed during a home visit with the German version of the Attachment Story Completion Task. Attachment patterns of 28 full-term controls were taken from a previous study. Primary outcomes were attachment security and attachment security score. Secondary outcomes for the preterm groups were infant behavioural problems, parental stress, perceived social support, maternal depressive symptoms, and infant development. Very preterm infants had the highest rate of insecure attachment (81%) compared to moderate or late preterm infants (60%) and full-term infants (47%); (p= 0.013). Attachment security scores differed significantly between very preterm and full-term infants (p= 0.001). Secondary outcomes were similar in very and moderate or late preterm cohorts. Prematurity was associated with an increased risk of insecure attachment at early school age. Interventions targeting attachment security are reasonable considering the high rate of behavioural problems following premature birth.