Although melatonin and cognitive–behavioural therapy have shown efficacy in treating sleep disorders in children with autism spectrum disorders, little is known about their relative or combined efficacy. One hundred and sixty children with autism spectrum disorders, aged 4–10 years, suffering from sleep onset insomnia and impaired sleep maintenance, were assigned randomly to either (1) combination of controlled-release melatonin and cognitive–behavioural therapy; (2) controlled-release melatonin; (3) four sessions of cognitive–behavioural therapy; or (4) placebo drug treatment condition for 12 weeks in a 1 : 1 : 1 : 1 ratio. Children were studied at baseline and after 12 weeks of treatment. Treatment response was assessed with 1-week actigraphic monitoring, sleep diary and sleep questionnaire. Main outcome measures, derived actigraphically, were sleep latency, total sleep time, wake after sleep onset and number of awakenings. The active treatment groups all resulted in improvements across all outcome measures, with moderate-to-large effect sizes from baseline to a 12-week assessment. Melatonin treatment was mainly effective in reducing insomnia symptoms, while cognitive–behavioural therapy had a light positive impact mainly on sleep latency, suggesting that some behavioural aspects might play a role in determining initial insomnia. The combination treatment group showed a trend to outperform other active treatment groups, with fewer dropouts and a greater proportion of treatment responders achieving clinically significant changes (63.38% normative sleep efficiency criterion of >85% and 84.62%, sleep onset latency <30 min). This study demonstrates that adding behavioural intervention to melatonin treatment seems to result in a better treatment response, at least in the short term.