Cerebral palsy (CP) is one of the most common causes of serious physical disability in childhood and is a persistent movement disorder before the age of three. This disorder can negatively affect both the child and their family. In recent years, the use of melatonin as a safe, effective, and cheap drug has been expanding in improving the sleep disorders of these children. Therefore, this study aimed to investigate melatonin's effect on sleep disorders in children with CP. This double-blind clinical trial was conducted on children aged 2 to 12 years with CP who were referred to the pediatric neurology clinic for sleep problems. The participants were included in the study by convenience sampling. After obtaining informed consent from parents, patients were divided randomly into two intervention (melatonin) and control (placebo) groups. In the intervention group, patients received oral melatonin tablets, and in the control group, patients received a placebo (3 mg oral lactose) 30 minutes before going to sleep. The results of this study showed no significant relationship between age and gender with sleep disorders in children with CP (P>0.05). A significant effect of melatonin on sleep disorders was found in children with CP. The greatest effect of melatonin is the time required to start falling asleep. Melatonin was associated with decreased time needed to fall asleep and increased sleep duration. The results of the study demonstrated that sleep disorders are prevalent among children with CP. Therefore, proper and timely treatment of these children is crucial. According to the present study's findings, melatonin effectively improves the time of falling asleep and these children's sleep duration.