Poetry as an art form predates literacy. Some of the earliest poetry is believed to have been orally recited or sung. Following the development of writing, poetry has since developed into increasingly structured forms, though much poetry since the late 20th century has moved away from traditional forms towards the more vaguely defined free verse and prose poem formats.
Poetry was employed as a way of remembering oral history, story (epic poetry), genealogy, and law. Poetry is often closely related to musical traditions, and much of it can be attributed to religious movements. Many of the poems surviving from the ancient world are a form of recorded cultural information about the people of the past, and their poems are prayers or stories about religious subject matter, histories about their politics and wars, and the important organizing myths of their societies.
The oldest surviving poem is the Epic of Gilgamesh, from the 4th millennium BC in Sumer (in Iraq/Mesopotamia), which was written in cuneiform script on clay tablets and, later, papyrus. The Epic of Gilgamesh is based on the historical king Gilgamesh. The oldest love poem, found on a clay tablet now known as Istanbul #2461, was also a Sumerian poem. It was recited by a bride of the Sumerian king Shu-Sin, who ruled from 2037–2029 BC. The oldest epic poetry besides the Epic of Gilgamesh are the Greek epics Iliad and Odyssey and the Indian Sanskrit epics Ramayana and Mahabharata. The longest epic poems ever written were the Mahabharata and the Tibetan Epic of King Gesar.