A genomic analysis traces Indian ancestry back to a migration out of Africa around 50,000 years ago, after which humans interbred with Neanderthals and Denisovans and spread throughout Eurasia. About 10,000 years ago, farmers from Iran and nomadic herders from the Central Asian steppe mixed with the local hunter-gatherers. Then, 5,000 years ago, endogamy led to bottlenecks. This complex evolutionary history has shaped the genetic variation and health and disease in India.