Acquired immunodeficiency syndrome (AIDS) of humans is caused by two lentiviruses, human immunodeficiency viruses types 1 and 2 (HIV-1 and HIV-2). Here, we describe the origins and evolution of these viruses, and the circumstances that led to the AIDS pandemic. Both HIVs are the result of multiple cross-species transmissions of simian immunodeficiency viruses (SIVs) naturally infecting African primates. Most of these transfers resulted in viruses that spread in humans to only a limited extent. However, one transmission event, involving SIVcpz from chimpanzees in southeastern Cameroon, gave rise to HIV-1 group M-the principal cause of the AIDS pandemic. We discuss how host restriction factors have shaped the emergence of new SIV zoonoses by imposing adaptive hurdles to cross-species transmission and/or secondary spread. We also show that AIDS has likely afflicted chimpanzees long before the emergence of HIV. Tracing the genetic changes that occurred as SIVs crossed from monkeys to apes and from apes to humans provides a new framework to examine the requirements of successful host switches and to gauge future zoonotic risk.