The Necrons' story is one of ancient betrayal. Eons ago, the Necrontyr race clung to their short lives in fear of oblivion at the hands of their massive and ravaging star. They pushed the limits of science in an effort to lengthen their lives, but to no avail. In their desperation, they looked into space and discovered ethereal beings feeding on the energies of whole stars. They named these beings "the Star Gods," or C'tan. The C'tan offered the Necrontyr people immortality, but only at a terrible price. It is uncertain if the Necrontyr knew this price, but their race was completely purged and transferred into new metal bodies, stripped of thought and self.
The C'tan are enormous energy beings who were given physical embodiments by the Necrontyr. They encased the C'tan inside vast lumps of their living metal, the same material they used in their spacefaring ships. The metal mutated into the shape desired by the personality of the being inside. The Night Bringer was forged into a dark figure with a large cloak, adding to the fear it already inspires, and the Deceiver was formed into a wily shape. Originally there were a large number of C'tan, but due to the machinations of the Deceiver, this number reduced to four, The Night Bringer, The Deceiver, The Void Dragon, and The Outsider. An ancient Eldar poem refers to a C'tan who sleeps on a Vaul-Moon (an Eldar term for factory world) and is known as the Dragon. This is widely believed to refer to the Noctis Labyrinth on Mars. The locations of the other remaining C'tan are unknown.
Once the Necrontyr accepted the C'tan's offer and their life-essence was encased in living metal bodies, their minds and senses became dulled until they became slaves of the C'tan. The C'tan used these warrior-slaves to harvest the lifeforms of the galaxy so the Star Gods could feast on souls and the newly christened Necrons served this purpose very well. Now focusing on gathering souls, the C'tan assaulted the dominant species at the time, the Old Ones, and began an unstoppable march upon their domain. The Necrons burst into the Old Ones strongest fortresses, overcoming their magicks and technology and forced the Old Ones to seed planets with life to help fight the C'tan, including the Eldar and Krork. These races had the ability to use the Warp to defend themselves, as the C'tan seemed harmed only by psychic energy. Gradually, the Old Ones were forced back by the relentless push of the C'tan and billions of souls were harvested for the Star Gods, increasing their power to incredible proportions.
The C'tan had been working on a plan to cripple the Old Ones, and eventually it came to fruition. They burst into and destroyed the Webways discovered by the Old Ones. Without these portals, the Old Ones were unable to move troops throughout the galaxy. With the new races using so much Warp power for the purposes of killing, the benign creatures in the Warp mutated into the evil creatures they are today. At the precipice of victory, the Enslavers emerged from the now-tumultuous Warp and forced the C'tan and their slaves back, by preying on the younger races and starving them of the precious lifeforce they need to feed upon. The C'tan began to consume their own kind,eventually leaving only four remaining who then went into stasis to avoid the onslaught and allow the galaxy to repopulate without the psychic swarm so they could emerge and reconquer their empire. However, this kindled a single-minded determination in the C'tan to eliminate the only threat to their conquest, the Warp. Thus began the Great Work, the severing of the Materium and Immaterium so that the C'tan would go unchallenged once again.
For countless years the Necrons remained in their deathless slumber in their tombs on many worlds as the Enslavers were defeated by the races the Old Ones created, this however, would not last. In 783.M41, the Eldar Farseer Eldrad Ulthran of Craftworld Ulthwé witnessed a vision where on the dead world of Maedrex, an Imperial Explorator team would arrive and unwittingly awaken the Necrons on that planet. To prevent this, the Eldar struck quickly and destroyed the Imperial ships before descending onto the planet where they purged it of the Necron presence. Later came the first reported contact between the Necrons and the Imperium of Man came in 897.M41 during the raid on Sanctuary 101 which was garrisoned by the Adepta Sororitas. At the time, the invaders were identified as an unknown form of xenos species but later reported as being the first encounter with the awakening Necrons. Its also later reported that the invaders did not attack the colony but instead emerged from the ground itself.
In 936.M41, a tomb complex awoke on the planet Malbrede due to fighting between the Ultramarines and a Tau expeditionary force. With this new threat emerging, the two enemies joined forces to defeat the emerging Necrons. After the battle, Marneus Calgar committed Exterminatus on Malbrede, but allowed the Tau to evacuate their forces before destroying the world.