Whether or not childhood sleep problems and anxiety occur simultaneously, or one precedes the other, and any effect of autistic traits on this relationship remains unclear. We investigated longitudinal associations between sleep and anxiety at 2 years and sleep and anxiety at 8 years controlling for demographic variables. We also examined the additional influence of autistic traits at 2 years on sleep problems and anxiety at 8 years. Participants were from the Western Australian Pregnancy Cohort (Raine) Study, where 2900 pregnant women were recruited between 1989 and 1991 and their children assessed every 2-3 years thereafter. Demographic information was provided at 16-18 weeks gestation. Children's sleep and anxiety at 2 and 8 years and autistic traits at 2 years were measured using the Child Behavior Checklist. Hierarchical multiple regression models tested the prediction of both anxiety and sleep problems at 8 years. Sleep problems at 2 years and 8 years, anxiety at 2 years, and autistic traits at 2 years were significantly associated with anxiety at 8 years. Sleep problems at 2 years and anxiety at 8 years were significantly related to sleep problems at 8 years. Each of these models explained about 20% of variance. Childhood sleep problems, anxiety and autistic traits are interrelated and can occur concurrently in young children, but the best predictor of poor sleep in middle childhood is concurrent anxiety and vice versa. Anxiety and sleep problems may be an early indicator of autism in young children and early autistic traits may also contribute to anxiety problems later in childhood.