Humans and many animals show 'freezing' behavior in response to threatening stimuli. In humans, inappropriate threat responses are fundamental characteristics of several mental illnesses. To identify small molecules that modulate threat responses, we developed a high-throughput behavioral assay in zebrafish (Danio rerio) and evaluated 10,000 compounds for their effects on freezing behavior. We found three classes of compounds that switch the threat response from freezing to escape-like behavior. We then screened these for binding activity across 45 candidate targets. Using target profile clustering, we identified the sigma-1 (σ1) receptor as having a role in the mechanism of behavioral switching and confirmed that known σ1 ligands also disrupt freezing behavior. Furthermore, mutation of the gene encoding σ1 prevented the behavioral effect of escape-inducing compounds. One compound, which we call finazine, potently bound mammalian σ1 and altered threat-response behavior in mice. Thus, pharmacological and genetic interrogation of the freezing response revealed σ1 as a mediator of threat responses in vertebrates.