To study the effect of religiosity on terrorism, we focus on one of the five pillars of Islam: Ramadan fasting. For identification, we exploit two facts: First, daily fasting from dawn to sunset during Ramadan is considered mandatory for most Muslims. Second, the Islamic calendar is not synchronized with the solar cycle. We find a robust negative effect of more intense Ramadan fasting on terrorist events within districts and country-years in predominantly Muslim countries. We argue that this effect partly operates through a decrease in public support for terrorism, which in turn reduces the operational capabilities of terrorist groups.