We examine (i) the impact of terrorist attacks on the level of hate speech against refugees in online discussions, and (ii) how the effect of terrorist attacks depends on the ambiguity of social norms of prejudice expression. To this end, we report on the results of a unique combination of a natural and a lab-in-the-field experiment. We exploit the occurrence of two consecutive Islamist terrorist attacks in Germany, the W{\"u}rzburg and Ansbach attacks, in July 2016. Hateful comments towards refugees, but not in other topics, increased as a result of the attacks. The experiment compares the effect of the terrorist attacks in contexts where a descriptive norm against the use of hate speech is emphasized to contexts in which the norm is ambiguous. We find that participants were especially reliant on normative cues in their context after the terrorist attacks. We elaborate a mechanism that explains the increase in online hate as contingent on terrorist attacks creating uncertainty about the social acceptability of the public expression of hate. The implications of the findings for the literature on social norms are discussed.