In one version, Huitzilopochtli was killed by the moon goddess Coyolxauhqui and her 400 brothers, known as the Centzon Huitznahuas, during the battle of Coatepec. He was dismembered, and his limbs were scattered across the battlefield. However, Huitzilopochtli's sister, the goddess Malinalxochitl, gathered his remains and brought him back to life.
In another version, Huitzilopochtli sacrificed himself on a pyre to become the sun. In this version, he is often depicted as a fiery god who rises from the east each morning and travels across the sky until he sets in the west. As the sun, Huitzilopochtli is considered the giver of life and is associated with fertility, warmth, and nourishment.