The bat-moth arms race has existed for over 60 million y, with moths evolving ultrasonically sensitive ears and ultrasound-producing organs to combat bat predation. The evolution of these defenses has never been thoroughly examined because of limitations in simultaneously conducting behavioral and phylogenetic analyses across an entire group. Hawkmoths include >1,500 species worldwide, some of which produce ultrasound using genital stridulatory structures. However, the function and evolution of this behavior remain largely unknown. We built a comprehensive behavioral dataset of hawkmoth hearing and ultrasonic reply to sonar attack using high-throughput field assays. Nearly half of the species tested (57 of 124 species) produced ultrasound to tactile stimulation or playback of bat echolocation attack. To test the function of ultrasound, we pitted big brown bats (Eptesicus fuscus) against hawkmoths over multiple nights and show that hawkmoths jam bat sonar. Ultrasound production was immediately and consistently effective at thwarting attack and bats regularly performed catching behavior without capturing moths. We also constructed a fossil-calibrated, multigene phylogeny to study the evolutionary history and divergence times of these antibat strategies across the entire family. We show that ultrasound production arose in multiple groups, starting in the late Oligocene (∼26 Ma) after the emergence of insectivorous bats. Sonar jamming and bat-detecting ears arose twice, independently, in the Miocene (18-14 Ma) either from earless hawkmoths that produced ultrasound in response to physical contact only, or from species that did not respond to touch or bat echolocation attack.acoustic | antipredator defense | bat-moth interactions | evolution | Sphingidae