There are few effective sun-safety education programs for use in secondary schools. Project aims were to create a sun-safety curriculum for grades 6 to 8, and to test whether exposure to the curriculum would increase children's sun-protection behavior. A pair-matched, group-randomized, pre--post test, controlled trial was performed with middle schools as the unit of randomization. Teachers implemented the six-unit sun-safety curriculum in 2001-2003, and analyses were performed in 2003-2004. A total of 2038 children from 30 middle schools in Colorado, New Mexico, and Arizona. Self-reported sun-protection behavior using frequency ratings and diary. Compared to control schools, children receiving the curriculum reported more frequent sun protection (p=0.0035), and a greater proportion wore long-sleeved shirts during recess (p<0.0001) and applied sunscreen (p<0.0001). Exposure to the curriculum improved knowledge (p<0.0001), decreased perceived barriers to using sunscreen (p=0.0046), enhanced self-efficacy expectations (p=0.0577) about sun safety, and reduced favorable attitudes toward sun tanning (p=0.0026 to <0.0001). In intent-to-treat analyses, the treatment effect was eliminated only under the most conservative assumptions about dropouts. Educational approaches to sun safety in middle school may be effective for improving children's sun safety. Potential trial limitations include measuring short-term outcomes, focusing on young adolescents, using active parental consent, and testing in the American Southwest.