The COVID-19 pandemic has highlighted the need for control measures that reduce the epidemic peak (“flattening the curve”). Here we derive the optimal time-limited intervention for reducing peak epidemic prevalence in the standard Susceptible-Infectious-Recovered (SIR) model. We show that alternative, more practical interventions can perform nearly as well as the provably optimal strategy. However, none of these strategies are robust to implementation errors: mistiming the start of the intervention by even a single week can be enormously costly, for realistic epidemic parameters. Sustained control measures, though less efficient than optimal and near-optimal time-limited interventions, can be used in combination with time-limited strategies to mitigate the catastrophic risks of mistiming.