He is best friends with Zero, the last creation of Dr. Wily. Zero was named for the number of people that would be alive when he carried out his programming.
Dr. Cain discovered Mega Man X and was amazed at how advanced he was, being able to really think for himself and experience emotions.
Soon, Dr. Cain began creating Replodis, or robots built to the tune of X and his ability to experience emotion.
His most powerful creation was Sigma. Sigma was built when more and more Reploids became Maverick, or dangerous to humans. He headed up the Maverick Hunters, a group of Reploids dedicated to hunt down Mavericks.
One day, Sigma and Zero engaged in a great battle deep in a cave. However, during the climax of the battle, a virus which was implanted in Zero transfered itself in entirety, along with memories Zero had, to Sigma. Sigma won the battle and ordered Zero taken back to headquarters to be repaired, but Sigma disappeared. He would reappear later as X and Zero's greatest rival and biggest threat.
Zero was repaired and became the new leader of the Maverick Hunters. During a particuarly bad outbreak of Maverick activity, X decided that he was not doing enough to help. He set off and at the end of his first mission fought Vile in his ride armor, who easy defeated X in battle. However, before Vile could destroy X, Zero stepped in and saved X.
After X defeated the Mavericks, he and Zero mounted an assault on Sigma's fortress. Not long after their assault began however, they ran into Vile again. Not wanting to waste time, Zero tried his hand at defeating him but was captured.
X stepped into the ring to face him but was once again defeated. Before Vile could finish him off though, Zero latched onto his armor and used his self destruct feature. Vile escaped without a scrath, only to find an infuriated and rejuvinated X who made quick work of him. Zero told X he couldn't repair himself but that X could defeat Sigma now.
After X left Zero, it is presumable that his parts were stolen by minions of Sigma.
After working his way through the fortress, X defeated Sigma.
Shortly after, X was ordered to inspect a scrapyard. However it was a trap set by the X-Hunters.
X once again had to defeat Mavericks as well as the X-Hunters to regain Zero's parts and rebuild him. And once again he fought and defeated Sigma.
Upon being defeated again, Sigma said that he couldn't understand what Zero was doing, seeing as he was the "last of the good doctor's creations," or Dr. Wily's last creation.
With Zero rebuilt and heading up the special #0 Maverick Hunter division and X the 17th Unit, Dr. Doppler seemed to have invented an anti-virus for the Sigma Virus. However, it was not so, as Doppler was being controlled by Sigma.
X and Zero defeated the Mavericks and once again assaulted Sigma's stronghold. However, Zero was felled on the way to defeating Sigma and passed his Z-Sabre onto X.
After X defeated Sigma's body for the third time, his spirit said that he would simply posess X and take over the world that way.
After a chase, Sigma was stopped by Dr. Doppler, who, to atone for his past sins, destroyed Sigma using an anti-virus he created.
After undergoing repairs, X and Zero were called upon once again to stop Sigma. This time, a group of Hunters had once again gone Maverick and felled the space colony Eurasia. This was blamed on the Repliforce. erroneously.
X and Zero killed Conel, the brother of Iris and that made Iris seek revenge upon Zero, who, in self defense, destroyed her. He was extremely upset by this but continued on.
After battling and defeating the General, there was another showdown with Sigma. Sigma had already succeded in activating a doomsday device. However, the General destroyed it, sacrificing himself.
Sigma returned once more and this time plotted to have another colony destory the Earth.
X and Zero fought against the clock and Mavericks to ensure this didn't happen.
They were able to collect parts for an ancient laser to knock the colony off a path, however it missed. This prompted HQ to send a manned capsule to knock it off course. Zero went, and fought and destroyed Sigma. In the wreckage, he came to only to find he had been infected by a virus.
X confronted him and told him to come back to HQ, but he refused. He was looking through the rubble for clues to his past. X insisted, and the two battled.
After a fierce battle, the two were both heavily damaged. However, Sigma was not finished, and blasted straight through both X and Zero. Zero then destroyed Sigma with a last blast before leaving.
At headquarters, X could not remember anything about Zero.
A new enemy named (shit I forget his name) created a copy of Zero who commited some terrible crimes.
Isis, a dummy placed by the new enemy, headed a group of Nightmare Hunters.
Nightmares could take over a Reploid and control it.
X fought against the Zero Nightmare before the real Zero came and finished the job. X then remembered his longtime partner and the two fough and took down the new bad guy.
Afterwards, Sigma himself arrived to destory X and Zero, but was far too weak and was defeated easily.
Soon after this, Zero ran off again and was sealed in a capsule for 100 years.
After being activated again, Zero had some memory loss. In this world, X was the evil ruler of a "Utopia" under prepetual martial law.
Zero fought through to face X only to be forced to destroy this evil version of his old friend. And there you have it. Sorry if it's long winded.