A stochastic continuous-infection model is developed that describes the evolution of an infectious disease introduced into an infinite population of susceptibles. The proposed model is the natural stochastic counterpart of the deterministic model for epidemics, based on the renewal equation. As in the deterministic model, the infectivity of an infected individual is a function of his age-of-infection, that is the time elapsed since his own infection. A time-dependent external source of infection is included. The model provides analytical expressions that describe the stochastic infective-age structure of the population at any moment of time. It is shown that the mean value of the number of infectives predicted by the stochastic model satisfies the renewal equation, which furnishes a formal solution of this equation. The model also yields simple expressions for the expected arrival times of infectives, that can be useful for the inverse problem. An explicit expression for the final size distribution is obtained. This leads to a precise quantitative threshold theorem that distinguishes between the possibilities of a minor outbreak or a major build-up of the epidemic.