A cornerstone of epidemiologic research is to understand the causal pathways from an exposure to an outcome. Mediation analysis based on counterfactuals is an important tool when addressing such questions. However, none of the existing techniques for formal mediation analysis can be applied to survival data. This is a severe shortcoming, as many epidemiologic questions can be addressed only with censored survival data. A solution has been to use a number of Cox models (with and without the potential mediator), but this approach does not allow a causal interpretation and is not mathematically consistent. In this paper, we propose a simple measure of mediation in a survival setting. The measure is based on counterfactuals, and measures the natural direct and indirect effects. The method allows a causal interpretation of the mediated effect (in terms of additional cases per unit of time) and is mathematically consistent. The technique is illustrated by analyzing socioeconomic status, work environment, and long-term sickness absence. A detailed implementation guide is included in an online eAppendix (http://links.lww.com/EDE/A476).