Genetically engineered "offspring" of Anubis, created on P3X-584 in concert with an Ancient genetic manipulation device. Khalek possessed the memories of Anubis and all those who came before, likely including the queen that originally spawned him. Exactly when Khalek was created is unknown, but he possessed Anubis's memories up to, and perhaps beyond, the destruction of Abydos (as he recalls the confrontation with the ascended Daniel Jackson). Anubis -- half-ascended when he created Khalek -- managed to generate (or locate) D.N.A. prior to his ascension to build him.
When found, Khalek was frozen inside an Ancient stasis unit in an underground lab on 584. He was taken back to Stargate Command, and when he heard he was on Earth Khalek implied that a malevolent force kidnapped him from his home planet to experiment on him. It was only after Dr. Jackson managed to wade through pages of Ancient-coded notes that he realized the danger posed by the engineered human.
When Khalek awoke to restraints in an S.G.C. isolation ward he attempted to curry favor in Dr. Jackson, who called his bluff. Immediately Khalek reverted to his Anubis-like traits, attacking the base personnel and attempting to escape. According to the Ancient brain scanner, upon his arrival on Earth Khalek was approximately 60% complete in his genetic treatments to become a fully ascended being. However, after becoming shot and regenerating (helping the process along), he reached an impasse at 80%. He could not progress forward and ultimately ascend without returning to 584 for more treatments.
Khalek used his psycho-kinesis to dial P3X-584 and traveled through the Stargate -- but he did not know about the Stargate authorization device (which had been rigged to "call-forward" him right back to Earth. Surprised to find himself right back where he had started, Khalek was shot dead.
Prototype - SG-1 brings a young man back to the S.G.C., who they believe was suffering from experimentation by a Goa'uld, and soon realize he is actually the equivalent of Anubis's son.