Research about the economic consequences of past epidemics has mostly focused on the experience of industrialized countries, thus providing little knowledge about the effects of health shocks on developing economies. We fill this gap by studying the impact of the 1918 influenza in Java, with a new dataset on aggregate food production and district-level figures on (i) sugar production, the major export commodity and the predominant source of labour demand; (ii) agricultural and plantation wages, and (iii) annual crude death rates. The mortality impact of the influenza on Java was high, as crude mortality rates doubled in 1918 relative to the preceding years, but its economic impact was mixed. Aggregate food production did not decline, but sugar output did fall in 1919. Indeed, our regional panel data analysis does not establish a direct relationship between regional epidemic mortality variation and sugar output decline. Instead, we hypothesize that economic activity was rediverted towards food production in order to avoid famine that could have resulted from the combined effects of disrupted shipping at the end of the First World War, climatic conditions and the public health crisis. This is supported by both qualitative observations and quantitative evidence suggesting that those regions that were highly suitable for rice production saw a larger reduction in sugar production, and that in regions that had more flexibility in land tenure arrangements experienced substantially greater reductions in sugar output.