Are African girls more exposed than boys to risk of infant mortality during crises and if so, is the difference due to discrimination? To answer these questions, we combine retrospective fertility data on over 1.5 million births from Demographic and Health Surveys with data on rainfall variability and find a substantial gender difference favouring boys following droughts. We substantiate that this difference has social determinants by showing that the difference is only present in contexts in which we would expect discrimination of daughters. The difference is only present in communities with strong preferences for sons and in areas where fertility desires are low. In areas with low levels of female employment there is a large gender gap following droughts, especially for infants with mothers who are not working. In contrast, there is no gender difference in infant mortality after droughts in areas where many women work, irrespective of the employment status of the individual mother under consideration. No difference is found across mothers with different levels of education, perhaps due to the lower fertility preferences of more educated women. In total, the results indicate a large and socially founded gender bias in infant mortality after crises. They also shed light on factors behind the African exceptionalism of little gender discrimination in infant mortality. As communities with strong son preferences, low fertility preferences, and low female employment display gender bias after crises in Africa, the results are consistent with factors explaining differences in gender biases between countries across the world.