The Emperor was born during the 8th Millenium BC, back when the three gods of Chaos (the fourth, Slaanesh, had not yet been "born," as the Fall of the Eldar had not yet occurred) hadn't reached thier full power, in ancient central Anatolia (modern-day Turkey). He was created by the shamans of ancient Earth to keep them alive, as they were being devoured by daemons instead of reincarnating when they died, and without them, humanity would turn to Chaos. They did this through ritual mass suicide. As each shaman died, their soul entered the Warp, until so many had overwhelmed the hungry daemons and created the future Emperor's soul. A year later, a family of Anatolian farmers had a child who possessed this soul. The collective souls of the shamans had granted the Emperor immortality and powerful psychic abilities, or magic as it was known at the time. He used these powers, under different names from human myth and history, to lead humanity to greatness and to protect it from the Warp. Though most of these ancient figures are unknown, the short story The Last Church by Graham McNeil suggests that he may have been Saint George, based on an artwork found in the church which the story takes place in, depicting "a battle between a golden knight and a silver dragon." This theory is supported by the fact that, sometime prior to the Unification Wars, the Emperor would battle the Void Dragon, one of the god-like energy beings known as the C'tan once worshipped by the Necrontyr, supposedly burying the creature's physical form somewhere on Mars - the Emperor is commonly shown wearing a suit of golden power armour, as seen above, whilst necrodermis, the living metal used to create a physical form for the C'tan, has appeared similar to iron or steel in some cases and, more commonly, silver in others, and, as it's name suggests, the physical form of the Void Dragon is believed to be that of a dragon.
Most of his history is unknown before the 30th Millennium AD, whereupon he became the Emperor and led humanity, first in the Unification Wars of Terra and then during the Great Crusade, where he set out to conquer the galaxy for humanity. He stopped fighting during the 35th Millenium, before what would come to be known as the Horus Heresy, where he named his son Horus Lupercal Warmaster, leader of humanity's armies for the rest of the Great Crusade. His other 17 sons each had their own thoughts about Horus' new title, but ultimately followed his command. During the 36th Millenium, his son Horus would be corrupted by the words of Erebus, first chaplain of the Word Bearers legion and the man responsible for turning his brother Lorgar to Chaos, forcing him to return to the field of battle. Though he only fought once during the Horus Heresy, this battle would be the decisive Battle of Terra, where he would kill Horus and utterly destroy his soul, preventing the Chaos Gods from reviving him. However, he was mortally wounded during the fight, and was permanently interred into the Golden Throne, his physical form slowly decaying whilst his psychic presence in the Warp did what it could to protect humanity.