In the Kingdom Hearts series, he was the first apprentice of Ansem the Wise, having been discovered "on death's door" and afflicted with amnesia when he was young. He was Ansem's first test subject, and carried Ansem's experiments further than advised, even though he and the others were forbidden from any more experimentation and ordered to destroy the results of their past research. He eventually stole Ansem's identity and became a Heartless and a Nobody along with the others. His Nobody is Xemnas, the leader of Organization XIII. His Heartless was known as Ansem, but is simply Xehanort's Heartless.
Sora wasn't very happy to find out that the man he thought was Ansem was really the Heartless of his apprentice, Xehanort.