We analyze how to optimally engage in social distancing in order to minimize the spread of an infectious disease. We identify conditions under which any optimal policy is single-peaked, i.e., first engages in increasingly more social distancing and subsequently decreases its intensity. We show that an optimal policy might delay measures that decrease the transmission rate substantially to create herd-immunity and that engaging in social distancing sub-optimally early can increase the number of fatalities.