Hayagriva refers to a horse-themed avatar, also known as Ashvamukha, Ashvasirsa and Hayashirsa. In one legend, Hayagriva is the persistent horse who brought back the Vedas from asuras Madhu and Kaitabha who stole them, during the mythical battle between good and evil - a battle described in the Mahabharata. In an alternate mythology, Hayagriva refers to a demon who stole the Vedas and was slain by Vishnu in his Matsya (fish) avatar, a story presented in the Bhagavata Purana. In a third version, a mythology presented in medieval era Devi-Bhagavata Purana, Vishnu appears in a hybrid human-body, horse-headed form called Hiyagriva who battles and kills a horse-like demon also named Hiyagriva. Finally, in Pancaratra Vaishnava tradition, Hayagriva-Vishnu becomes the god of learning and one who protects, maintains the Vedas. In the Hayagriva Upanishad, the term refers to half-human horse-headed Vishnu avatar who is the teacher of humanity.