We study the susceptible-infected-recovered model of epidemics in the vicinity of the threshold infectivity. We derive the distribution of total outbreak size in the limit of large population size N . This is accomplished by mapping the problem to the first passage time of a random walker subject to a drift that increases linearly with time. We recover the scaling results of Ben-Naim and Krapivsky that the effective maximal size of the outbreak scales as N2/3, with the average scaling as N1/3, with an explicit form for the scaling function.