In 321 BC, exiled general Chandragupta Maurya, with the help of Chanakya, founded the Maurya dynasty after overthrowing the reigning Nanda king Dhana Nanda to establish the Maurya Empire. The Maurya Empire (322–185 BC), ruled by the Mauryan dynasty, was geographically extensive, powerful and a political-military empire in ancient India. During this time, most of the subcontinent was united under a single government for the first time. The exceptions were present day Tamil Nadu and Kerala (which was a Tamil kingdom at that time). The empire had its capital city at Pataliputra (near modern Patna). The Mauryan empire under Chandragupta Maurya would not only conquer most of the Indian subcontinent, defeating and conquering the satraps left by Alexander the Great, but also push its boundaries into Persia and Central Asia, conquering the Gandhara region. Chandragupta Maurya then defeated an invasion led by Seleucus I, a Greek general from Alexander's army. Chandragupta Maurya's minister, Kautilya Chanakya, wrote the "Arthashastra", a treatise on economics, politics, foreign affairs, administration, military arts, war and religion.