The legal treatises of ancient India, called Dharmaśāstras, are often read as records of the initial emergence of law from religion in South Asia. The Dharmaśāstras teach the dharma, or “sacred duty,” of different members of society. It is one of the dharmas of the king to adjudicate disputes that come before his courts, and it is widely accepted that a need to articulate the king's dharma led the composers of the Dharmaśāstras over time to fashion rules for state courts, a body of law called vyavahāra. Scholars such as Henry Sumner Maine and Max Weber saw in the Dharmaśāstras evidence of the disentanglement and rationalization of law, respectively. A close examination of our sources, however, shows that the law of royal courts emerged not within the Dharmaśāstra tradition, but within an adjacent and decidedly more secular tradition of statecraft. It was gradually absorbed into Dharmaśāstra texts, where it was reconfigured as sacred duty and its historical origins were obscured. This article argues that the early history of state law in India is best described, therefore, not as a transition from dharma to law, but as a transition from law to dharma.