Interactions between law enforcement agents in conservation (e.g., rangers) and illegal resource users (e.g., illegal hunters) can be violent and sometimes fatal, which negatively affects conservation efforts and people's well‐being. Models from social psychology, such as integrated threat theory (ITT) (intergroup interactions shape intergroup emotions, prejudices and perceived threats leading to hostile attitudes or behaviors between groups), are useful in addressing such interactions. Conservation approaches relying mainly on law enforcement have never been investigated using this framework. Using a structured questionnaire, we collected data from 282 rangers in protected and unprotected areas (n = 50) in northern Iran. We applied Bayesian structural equation modeling in an assessment of rangers’ affective attitudes (i.e., emotions or feelings that shape attitudes toward a person or object) toward illegal hunters in an ITT framework. Rangers’ positive perceptions of illegal hunters were negatively associated with intergroup anxiety (emotional response to fear) and negative stereotypes about a hunter's personality, which mediated the relationship between negative contact and affective attitudes. This suggests that negative contact, such as verbal abuse, may lead rangers to perceive illegal hunters as arrogant or cruel, which likely forms a basis for perceived threats. Rangers’ positive contact with illegal hunters, such as playing or working together, likely lowered their perceived realistic threats (i.e., fear of property damage). Perceived realistic threats of rangers were positively associated with negative contacts (e.g., physical harm). The associations we identified suggest that relationships based on positive interactions between rangers and illegal hunters can reduce fear and prejudice. Thus, we suggest that rangers and hunters be provided with safe spaces to have positive interactions, which may help lower tension and develop cooperative conservation mechanisms.