Abstract Introduction Duty hour regulations affect resident sleep, education, and patient care in complex ways. We performed a national cluster-randomized trial (iCOMPARE) in 63 internal medicine residency programs comparing the effects of the 2011 duty-hour standards to a more flexible set of duty hour rules characterized by maintaining an 80-hour workweek but without limits on shift length or mandatory time off between shifts, relative to patient mortality, intern educational outcomes, and intern sleep and alertness. Methods In the sleep and alertness sub-study, sleep duration and morning sleepiness and alertness were assessed with actigraphy, the Karolinska Sleepiness Scale, and a 3-minute Psychomotor Vigilance Test (PVT-B) for 14 days in 193 interns from 6 standard programs and 205 interns from 6 flexible programs. Results During the 14-day study periods, interns in standard and flexible programs averaged 7.03h sleep/24h (95% confidence interval [CI] 6.78h, 7.27h) and 6.85h sleep/24h (95% CI 6.61h, 7.10h), respectively. Sleep duration (difference between arms of -0.17h/24h; 1-sided lower 95% confidence limit -0.45h; NIM -0.5h; P=0.02 for noninferiority) and KSS sleepiness (difference 0.12 points; 1-sided upper 95% confidence limit 0.31 points; NIM 1 point; P<0.001) were noninferior in flexible versus standard programs. We could not establish noninferiority for PVT-B alertness (difference -0.3 lapses; 1-sided upper 95% confidence limit 1.6 lapses; NIM 1 lapse; P=0.10). Based on analyses by shift type, sleep duration was 1.77h shorter on days when interns in flexible programs finished an overnight shift relative to a regular day shift (p<.001), with significant decreases in subjective and objective alertness, and frequent reports of excessive sleepiness, especially between 12am and 6am. Conclusion There were no signs of relevant chronic sleep loss across shifts in interns in flexible programs relative to their standard program counterparts. Interns were able to compensate for the sleep lost during extended overnight shifts by increasing sleep duration on nights prior to day shifts, night shifts, and days off. Increased sleepiness and reduced alertness of interns following extended overnight shifts need to be mitigated and suggest a role for fatigue-risk management programs. Support Supported by NHLBI grants U01HL125388 and U01HL126088 and grants from the ACGME.