The Mahabharata is one of the two major Sanskrit epics of ancient India, along with the Ramayana. It tells of the Kurukshetra War and the fates of the Kaurava and Pandava princes. The epic contains much philosophical and devotional material in addition to its narrative. Traditionally attributed to the sage Vyasa, the oldest preserved parts date to around 400 BCE, though its origins likely fall between the 8th-9th centuries BCE. The text reached its final form by the early Gupta period in the 4th century CE. At over 100,000 shlokas, it is one of the longest epic poems in the world.