This study analyzed the relationship between terrorist threat and discrimination, operationalized by support for retributive justice against Islamic groups suspect of terrorist crimes. Two experimental studies were performed. Study 1 (N = 215) showed that the terrorist threat against the ingroup raises the support for the retributive procedures through the dehumanization of the outgroup. Study 2 (N = 304) analyzed how the mediating role of dehumanization in the relationship between terrorist threat and support for retributive justice is moderated by right‐wing authoritarianism (RWA). In addition, the study aimed to verify if the dehumanization of outgroup and RWA could explain the relationship between terrorist threat and discrimination of Muslim immigrants. The results indicated that adherence to RWA favors dehumanization of the outgroup and, consecutively, the discrimination, operationalized as support for the use of retributive justice. The adherence to RWA has been identified as the mechanism that explains the discrimination against Muslim immigrants.