Yet Enki risked the anger of Enlil and the other gods in order to save humanity from the Deluge designed by the gods to kill them. In the Legend of Atrahasis—later adapted into a section of the Epic of Gilgamesh—Enlil sets out to eliminate humanity, whose overpopulation and resultant mating noise is offensive to his ears. He successively sends drought, famine, and plague to do away with humankind. However, Enki thwarts his half-brother's plans by teaching Atrahasis the secrets of irrigation, granaries, and medicine. The enraged Enlil convenes a council of the gods and convinces them to promise not to tell humankind that he plans their total annihilation. Enki does not tell Atrahasis directly, but speaks of Enlil's plan to the walls of Atrahasis' reed hut, which, of course, the man overhears. He thus covertly rescues Atrahasis (Utnapishtim in the Epic of Gilgamesh) by either instructing him to build a boat for his family and animals, or by bringing him into the heavens in a magic ship.
Enlil is angry that his will has been thwarted yet again, and Enki is named as the culprit. Enki argues that Enlil is unfair to punish the guiltless Atrahasis for the sins of his fellows and secures a promise that the gods will not eliminate humankind if they practice birth control and live in harmony with the natural world. —New World Encyclopedia > Enki > Savior of humankind