Rex Lewis was in the U.S. Military alongside Duke and Ripcord, his best friends. His sister, Ana Lewis, was in a loving relationship with Duke, who would propose to her at a party before the team was deployed to their next mission. Ana agreed to marry Duke as long as he kept her brother safe. Duke promised her that he would.
During the mission, Duke sent Rex into a building to get information on some mysterious weapons project being constructed. An airstrike was set to destroy the building in five minutes. Rex ran inside to download the information while Duke and Ripcord defended the area against enemies outside.
When in the building, Rex saw a computer recording of a project known as "Nanomites," which were far more advanced than any project he had known of in today's scientific affairs. Rex was quite fascinated, being a scientist himself, not a soldier like the rest of the unit. Rex found Dr. Mindbender, creator of the Nanomite project for M.A.R.S., in the building. However, as Rex downloaded the info, the computer sounded a warning that the airstrike was inbound - it was coming too early, and he needed to evacuate fast. However Mindbender sealed the door of the bunker, blocking rex's means of escape and telling him that if they survived, he would tell Rex everything about the Nanomites. The explosion from the strike destroyed the building as Duke tried to rescue Rex. Ripcord held him back, and Rex was presumed dead.Rex and Mindbender survived, and Rex was given the proper medical equipment to live onward. Though Rex himself confirmed Mindbender's survival, his status within M.A.R.S. projects after the incident was not revealed. At Rex's funeral, an empty coffin lay in a grave as Ana looked down on it, greatly saddened. It is unknown if the coffin was actually empty, as Rex described the funeral as a "moving ceremony" and pointed out how "above," there was a folded flag in Ana's arms, suggesting he was silently watching from the open grave. The unit honored his sacrifice with a 21 gun salute, and his sister held a neatly folded American flag in her arms over his casket. However, after the "moving ceremony," he went with Mindbender to M.A.R.S. and learned all about the Nanomites. He joined M.A.R.S. and James McCullen, perfecting Mindbender's research and becoming McCullen's assistant. Rex, going by the alias of Doctor, felt sympathy for Ana, as Duke had "abandoned" her, being too depressed to face her. He also gained a great hatred for his former best friend, as he had left him for dead.
The Doctor broke into Ana's house one night and injected her with Nanomites, using her as his first test subject. Rex expressed that he truly did love his sister despite his corruption, and believed that he had given her life purpose and a way to deal with the pain of being "truly alone" by programming her to work for McCullen so that she could move on from her broken heart. Over the next four years, the Doctor managed to bring his Nanomite projects into the Neo-Viper project and Nanomite warhead designs. He showed his fascination with the Cobra snake and made it the symbol of his research. His assignments also including placing one of his 20 Neo-Vipers in Washingtion, D.C. and giving Zartan the ability to shape-shift into any person.When Duke was captured in Paris, Rex revealed himself by removing the wig he was wearing and his breathing mask. Duke was angered by Rex's betrayal and swore to kill him as he attempted to inject Duke with the Nanomites and make him a slave like the Neo-Vipers. By then, Baroness overcame her programing, attacked her brother, and saved Duke. Amazed that Ana was the first to overcome the programming, Rex held the switch that would cause the nanomites in her system to kill her from the inside, revealing he had become corrupted enough to willingly kill his own sister. McCullen was angered by her sacrifice for Duke because he loved her as well, and attempted to kill Duke with a flamethrower.
Duke shot McCullen with Baroness' powerful shockwave pistol, which backfired the flamethrower on McCullen, badly burning his face. Rex decided to escape as the M.A.R.S. base was destroyed by G.I. Joe. He grabbed the scarred and burned McCullen and forced him to come with him on his way out. They made it to a submarine (specifically given the Cobra insignia by Rex) and fled the crumbling base as Duke and Ana pursued them. The sub's propeller was damaged by a lucky missile shot from Duke, slowing them down. Rex revealed that he created special nanomites precisely for McCullen to be his servant, and used them to heal his face.
Rex gave McCullen the name "Destro" and programmed him against his will to be his right hand. He then donned a transparent, artificial mask in place of his Doctor breathing equipment that he had been designing among his research. He then took the name "Cobra Commander," and planned to replace the M.A.R.S. Industries with his Neo-Viper army and a new organization, Cobra. However, Destro and Cobra Commander were placed in high security prison by Duke, despite the Commander's vow that things had only just begun.
When the Alpha War broke out, Cobra Commander did not choose to ally with other factions, making Cobra a coveted ally for combatants. He is currently working on plastic Nanomites to avoid them being controlled by Magneto or any Toa, Matoran, Bohrok, Turaga, or Makuta of Magnetism.