Background Most totally blind people have non-24-hour sleep-wake disorder (non-24), a rare circadian rhythm disorder caused by an inability of light to reset their circadian pacemaker. In two consecutive placebo-controlled trials (SET and RESET), we assessed safety and efficacy (in terms of circadian entrainment and maintenance) of once-daily tasimelteon, a novel dual-melatonin receptor agonist. Methods We undertook the placebo-controlled, randomised, double-masked trials in 27 US and six German clinical research centres and sleep centres. We screened totally blind adults (18-75 years of age), who were eligible for the randomisation phase of SET if they had a non-24-hour circadian period (τ) of 24·25 h or longer (95% CI greater than 24·0 and up to 24·9 h), as calculated from measurements of urinary 6-sulphatoxymelatonin rhythms. For SET, we used block randomisation to assign patients (1:1) to receive tasimelteon (20 mg) or placebo every 24 h at a fixed clock time 1 h before target bedtime for 26 weeks. Patients who entered the open-label group receiving tasimelteon in SET or who did not meet the SET inclusion criteria but did meet the RESET inclusion criteria were screened for RESET. A subset of the patients who entered the open-label group before the RESET study and who had eligible τ values were screened for RESET after completing the open-label treatment. In RESET, we withdrew tasimelteon in a randomised manner (1:1) in patients who responded (ie, entrained) after a tasimelteon run-in period. Entrainment was defined as having τ of 24·1 h or less and a 95% CI that included 24·0 h. In SET, the primary endpoint was the proportion of entrained patients, assessed in the intention-to-treat population. The planned step-down primary endpoint assessed the proportion of patients who had a clinical response (entrainment at month 1 or month 7 plus clinical improvement, measured by the Non-24 Clinical Response Scale). In RESET, the primary endpoint was the proportion of non-entrained patients, assessed in the intention-to-treat population. Safety assessments included adverse events and clinical laboratory measures, assessed in all treated patients. These trials are registered with ClinicalTrials.gov, numbers NCT01163032 and NCT01430754. Findings Between Aug 25, 2010, and July 5, 2012, we screened 391 totally blind patients for SET, of whom 84 (22%) were assigned to receive tasimelteon (n=42) or placebo (n=42). Two patients in the tasimelteon group and four in the placebo group discontinued the study before τ was measured, due to adverse events, withdrawal of consent, and a protocol deviation. Circadian entrainment occurred in eight (20%) of 40 patients in the tasimelteon group compared with one (3%) of 38 patients in the placebo group at month 1 (difference 17%, 95% CI 3·2-31·6; p=0·0171). Nine (24%) of 38 patients showed a clinical response, compared with none of 34 in the placebo group (difference 24%, 95% CI 8·4-39·0; p=0·0028). Between Sept 15, 2011, and Oct 4, 2012, we screened 58 patients for eligibility in RESET, 48 (83%) of whom had τ assessed and entered the open-label tasimelteon run-in phase. 24 (50%) patients entrained, and 20 (34%) were enrolled in the randomisation phase. Two (20%) of ten patients who were withdrawn to placebo remained entrained compared with nine (90%) of ten who continued to receive tasimelteon (difference 70%, 95% CI 26·4-100·0; p=0·0026). No deaths were reported in either study, and discontinuation rates due to adverse events were comparable between the tasimelteon (3 [6%] of 52 patients) and placebo (2 [4%] of 52 patients) treatment courses. The most common side-effects associated with tasimelteon in SET were headache (7 [17%] of 42 patients given tasimelteon vs 3 [7%] of 42 patients given placebo), elevated liver enzymes (4 [10%] vs 2 [5%]), nightmares or abnormal dreams (4 [10%] vs none), upper respiratory tract infection (3 [7%] vs none], and urinary tract infections (3 [7%] vs 1 [2%]). Interpretation Once-daily tasimelteon can entrain totally blind people with non-24; however, continued tasimelteon treatment is necessary to maintain these improvements.