India has been underrepresented in genome-wide surveys of human variation. We analyse 25 diverse groups in India to provide strong evidence for two ancient populations, genetically divergent, that are ancestral to most Indians today. One, the ‘Ancestral North Indians’ (ANI), is genetically close to Middle Easterners, Central Asians, and Europeans, whereas the other, the ‘Ancestral South Indians’ (ASI), is as distinct from ANI and East Asians as they are from each other. By introducing methods that can estimate ancestry without accurate ancestral populations, we show that ANI ancestry ranges from 39–71% in most Indian groups, and is higher in traditionally upper caste and Indo-European speakers. Groups with only ASI ancestry may no longer exist in mainland India. However, the indigenous Andaman Islanders are unique in being ASI-related groups without ANI ancestry. Allele frequency differences between groups in India are larger than in Europe, reflecting strong founder effects whose signatures have been maintained for thousands of years owing to endogamy. We therefore predict that there will be an excess of recessive diseases in India, which should be possible to screen and map genetically. Analysis of genetic variation in 132 individuals from 25 diverse groups in India reveals that two ancient, genetically divergent populations are ancestral to most Indians today. One lineage, termed Ancestral North Indian, is genetically close to Middle Easterners, Central Asians and Europeans. The other, Ancestral South Indian, is not close to any group outside the subcontinent. The answers to several long-standing questions emerge from this work. It seems that 'caste' has been a powerful force shaping marriage in India for thousands of years — some anthropologists argued that its current strength was a product of British colonialism. And the enigmatic 'Negritos' of the Andaman Islands are identified as an ancient isolate from the Ancestral South Indian population. Allele frequency differences between population groups are high, in part due to the custom of within-group marriages, so it is likely that there is an excess of recessive diseases in India that can be screened for and mapped genetically. Genome-wide analysis of human variation in 25 diverse groups from India reveals two ancient populations, genetically divergent, that are ancestral to most Indians today. Traditionally upper caste and Indo-European speakers tend to be descended from a group that is genetically close to Middle Easterners, Central Asians and Europeans. The other group, the 'Ancestral South Indians', does not appear to be close to any group outside the subcontinent.