Thoth was one of the earliest Egyptian gods. He was popular throughout Egypt, but was particularly venerated in Khnum (Hermopolis Magna) where he was worshipped as part of the Ogdoad.
As the power of his cult grew, the myth was rewritten to make Thoth the creator god. According to this variant, Thoth (in the form of an ibis, one of his sacred animals) laid an egg from which Ra (Atum, Nefertum, or khepri) was born.
Other myths suggest that Thoth created himself through the power of language (in an interesting parallel to the phrase in the Gospel according to St John “in the beginning was the word, and the Word was with God, and the Word was God”). His song was thought to have created eight deities of the Ogdoad (the gods Nun, Heh, Kuk, and Amun and the goddesses Nunet, Hauhet, Kuaket, and Amaunet).