The Aeneid (/ɪˈniːɪd/ ih-NEE-id; Latin: Aenē̆is [ae̯ˈneːɪs] or [ˈae̯neɪs]) is a Latin epic poem that tells the legendary story of Aeneas, a Trojan who fled the fall of Troy and travelled to Italy, where he became the ancestor of the Romans. Written by the Roman poet Virgil between 29 and 19 BC, the Aeneid comprises 9,896 lines in dactylic hexameter. The first six of the poem's twelve books tell the story of Aeneas' wanderings from Troy to Italy, and the poem's second half tells of the Trojans' ultimately victorious war upon the Latins, under whose name Aeneas and his Trojan followers are destined to be subsumed.
The hero Aeneas was already known to Greco-Roman legend and myth, having been a character in the Iliad. Virgil took the disconnected tales of Aeneas' wanderings, his vague association with the foundation of Rome and his description as a personage of no fixed characteristics other than a scrupulous pietas, and fashioned the Aeneid into a compelling founding myth or national epic that tied Rome to the legends of Troy, explained the Punic Wars, glorified traditional Roman virtues, and legitimised the Julio-Claudian dynasty as descendants of the founders, heroes, and gods of Rome and Troy.
The Aeneid is widely regarded as Virgil's masterpiece and one of the greatest works of Latin literature.