Optimus was mentored by Sentinel Prime, the last Prime before him, and eventually became the leader of the Cybertronian scientific division, while Megatron became Lord High Protector of Cybertron. When Megatron was corrupted by The Fallen and formed the Decepticons, Optimus rose up against him in a vicious war.
Near the end of the war, after the Ark, along with Sentinel Prime and the Autobots' last hope of winning the war, vanished into space, Optimus was forced to launch the AllSpark into deep space to keep it out of the hands of the Decepticons. Without the AllSpark, Cybertron was reduced to a barren wasteland, forcing Optimus, the Autobots, and the Decepticons to abandon their homeworld and flee across space.
Following a beacon sent by Bumblebee the previous night, Optimus, Jazz, Ironhide, and Ratchet arrived on Earth in their protoform modes. After scanning a Peterbilt semi-truck as his alt mode, Optimus met up with Bumblebee, Ratchet, Jazz, and Ironhide in an alley and explained their history to Sam and Mikaela, as well as Sam's importance.
Optimus arrived at Sam's house and waited outside while Sam and Mikaela searched inside for the glasses. Much to Sam's exasperation, Optimus Prime, in his impatience, clumsily ruined his parents' garden. Prime's attempts to hide, such as having the Autobots transform into vehicle mode right in the backyard; were also less than satisfactory. Ultimately, Sam came so close to a panic attack that Prime was forced to order the Autobots to fall back. When the parents came to investigate, Prime's attempt to avoid discovery caused the house to shake, as Ron jumps into an old cast-iron tub and stated that he hates earthquakes; though this was to their benefit, as the father assumed that the damage to the yard was the result of an earthquake. Ironhide suggested that he should kill the parents as they were very irritating, but Optimus scolded his old friend. Despite all this, their presence remained undetected until Sector Seven arrived and abducted Sam, Mikaela and Sam's parents.
Optimus Prime sent the Autobots in pursuit of the SUV that contained Sam, Mikaela, and Sector Seven's director, Agent Simmons. Prime intercepted the vehicle carrying their young human friends, ripping the roof of the vehicle off, with the other Autobots disarming the agents, and made it perfectly clear to Simmons how enraged he was at him for trying to apprehend the two children, regarding this as a bad move on Simmons' behalf. Optimus then ordered his comrades to relieve the agents of their weapons and attempted to interrogate Simmons. The agents' lack of surprise at their appearance indicated that they had seen Cybertronians before, but Simmons refused to reveal any information. With a Sector Seven backup team en route, Prime ordered the Autobots to scatter, while he took Sam and Mikaela. While hiding under a bridge, Mikaela and Sam slipped and fell off Prime's shoulder. Bumblebee managed to catch them before impact but was captured, and Sam and Mikaela recaptured, by the organization after their retreat.
Optimus Prime, now in possession of the glasses which could tell him the location of the AllSpark, regretfully left Bumblebee in Sector Seven's hands, knowing that if they went after him, they would have to use deadly force. After regrouping the next day, Prime used the glasses to locate the AllSpark. Jazz raised objections to leave Bumblebee behind, but Prime remained firm in his belief of not harming the humans. Ironhide seemed okay with using deadly force, stating the humans were a "primitive and violent race," but Prime countered that when their time had come, the Cybertronians had been little different. Going on to explain the potential he saw in the humans, as well as reminding them that "freedom is the right of all sentient beings," Prime revealed to the Autobots his real plan for the AllSpark: if they could not defeat the Decepticons, Prime intended to merge the Cube with his spark. Though this would destroy the AllSpark, Ratchet cautioned Prime against this, as the Cube's raw power would also kill him. Prime believed that this was acceptable, vowing not to let another race suffer the mistakes of the Transformers. The glasses placed the AllSpark at Hoover Dam where, luckily, Bumblebee and the young humans were taken.
Optimus's team met up with Sector Seven, Bumblebee, Sam, and Mikaela enroute, who had planned to hide the AllSpark in nearby Mission City. While on the highway CA-210, he was attacked by Bonecrusher, who managed to tackle Optimus and drag him over the edge of a freeway overpass. During the battle, Optimus emerged victorious when he decapitated the rage-filled Decepticon; as the Decepticon swung his claw wildly, Optimus drew his sword from his right arm and sliced off one of Bonecrusher's arms, before brutally finishing off his enemy by driving the blade through Bonecrusher's neck, severing his head.
Optimus arrived at Mission City just in time to observe Megatron discarding the remains of Jazz and challenged him. Millennia in the ice had done nothing to lessen Megatron's hatred of his brother, and he launched himself in jet mode at the Autobot leader. Optimus leaped and grabbed hold of the wings, which was a really bad idea, as Megatron drove himself and Prime through an office block.
As they flew out of the building onto the street below, Megatron transformed and leaped on top of Prime, declaring the humans undeserving of life. Prime rejected his claims, saying that they deserved to choose for themselves. Megatron threw Prime across the street, declaring that if he wished to defend the humans, Prime could die with them. He then formed his fusion cannon from his forearms. The power-up time allowed Prime to draw his ion blaster and fire hitting Megatron. The Decepticon used the momentum to spin around, then used the fusion cannon to blast Prime across the street into another building. Megatron then resumed the hunt for Sam and the AllSpark.
Tracking Megatron to the deserted building, Prime barely managed to catch Sam after Megatron knocked him off the roof. Telling the boy to hold onto the Cube and stay close to him; Prime attempted to scale down the building, but Megatron jumped on Prime, causing them both to fall down hard onto the street below. Sam survived, however. Optimus told the boy that if he could not defeat Megatron, that Sam must put the AllSpark into his chest which would destroy it. As Sam sought cover, Optimus faced down Megatron, informed him that, "At the end of this day, one shall stand, one shall fall". Unfortunately, Megatron, even after years of stasis, proved to be far too powerful for Prime to defeat alone. The unit led by Lennox and the Raptor squadron laid down suppressing fire as Megatron reached for the AllSpark until Optimus finally took him down by sweeping his legs. Still, Megatron continued crawling toward the Cube. Believing he had lost, Optimus implored Sam to put the AllSpark into his chest. Sam instead thrust it into Megatron's chest, killing the Decepticon leader and destroying the AllSpark.
As Optimus watched his brother die, he regretfully said, there was little choice. He also told Sam he owed him a debt of gratitude for saving his life but was then informed that Jazz had not survived. Prime eulogized his comrade, then commented that they had gained new comrades in the humans, and was honored for their bravery. Bumblebee, who had finally regained his voice, requested permission to remain with Sam Witwicky, to which the young human eagerly agreed and Optimus approved. He noticed a fragment of the AllSpark in Megatron's chest cavity and removed it, then permitted the humans to dispose of the Decepticon corpses.
Though Megatron was killed and his Decepticons were defeated, the AllSpark was destroyed, leaving the Autobots unable to restore Cybertron. The Autobots elected to remain on Earth and Prime sent a message into deep space to any surviving Autobots in the galaxy to come to their new home on Earth, their long years of searching has finally come to an end. As the other Autobots rested, Optimus Prime looked to the sky, hoping his message had been heard.
With the death of Megatron and the destruction of the AllSpark, Optimus and his Autobots spent the next two years on Earth, helping N.E.S.T. hunt the remaining Decepticons on Earth. After locating and defeating Demolishor and Sideways in Shanghai, Optimus and the Autobots received a message from Demolishor that "The Fallen would rise again."
Optimus and N.E.S.T. returned to Diego Garcia where the National Security Advisor questioned the Autobots' continued presence on Earth and proposed having the Autobots leave, which Optimus agreed to if asked.
AfterRavage and Reedman stole the AllSpark shard, Optimus turned to the one ally he has that he believes can help convince the government - Sam Witwicky. Optimus met with Sam in a cemetery after sending Bumblebee to retrieve him, but Sam refused to help, believing that he couldn't help and that Optimus didn't need his help. Optimus was clearly frustrated saying that they needed Sam's help more than he knew.
Later, Optimus came to Sam, Mikaela and Leo's rescue after they were captured by the Decepticons. He then battled Megatron, Starscream, and Grindor. Optimus drove into a forest, but Megatron sped towards them in his vehicle mode from behind. Megaton fired some stray shots at Prime in his tank form before jumping onto Prime, intending to rip Prime apart while he was still in truck form. However, Optimus transformed at the last minute and punched Megatron while both robots were in mid-air. Megatron then tackled Prime, and both of them hurtled to the ground, while Sam hid on Prime's orders. Prime proceeded to beat Megatron with a tree and punched him in the back, before slashing him with one of his Energon swords. This prompted Megatron to call Grindor and Starscream, who came crashing through the trees to their leader's aid. Prime grappled with Starscream, kicking Megatron away at the same time, before holding Starscream upside down in the air and kicking him in the head. However, the three Decepticons formed a bully circle around Prime, with Grindor and Starscream shooting their machine guns at Prime before Megatron blasted him off his feet with his cannon. The blow sent Prime flying towards Sam, who managed to stay hidden.Megatron questioned why Prime was sacrificing the future of the Cybertronian race over a single human life. Urged by Sam to keep fightin, however, Optimus replied "You'll never stop at one!," deployed his twin Energon blades, and showed the Decepticons what a Prime is. Optimus slashed at all three Decepticons, in the process cuttin off Grindor's right arm and once again grappling with Starscream and using Starscream to swirl around the Decepticons by flipping over his back. Optimus tore Starscream's arm off, beat him with it, and then jumped onto Grindor, before tearing Grindor's head apart using his Energon hooks. Optimus jumped off, pulling his foes corpse to the ground. While calling out for Sam, Optimus was impaled from behind by Megatron and finished off with a fusion cannon blast through the chest. Collapsing to the ground, Prime's last words were "Sam, run..." The other Autobots then arrived, forcing Megatron and Starscream to retreat. Optimus was taken to Diego Garcia, and then transferred to Egypt as the request of Sam. The Battle of Egypt soon began, and after coming close to death, Sam received the rebuilt Matrix of Leadership, which he shoved into Prime's body. Optimus returned to life, much to the surprise of Jetfire. Before Prime could take action Howver, The Fallen arrived, knocking Optimus down, and stealing the Matrix, before retuning to the Harvester. Seeing him injured, the wounded Jetfire offered his parts to Optimus, before pulling his one spark out, ending his own life's to help,the last true living Prime. Ratchet and Jolt then attached the Jet Parts to Prime, who took off, flying to the pyramid. He fought against Megatron and The Fallen, and then blew up the Star Havester, knocking his enemies from the Pyramind. He shot Megatron in the face, blasting him away. He then fought The Fallen, who ripped off his Jetfire given upgrade. But Prime gained the upper hand, stabbing the Fallen and then ripping his face off, before punching though The Fallens back and out through his chest, grabbing the cons Spark and crushing it. [[Jetfire|Jetfire]]thumb|Jetfire[[Jetfire|Jetfire]]thumb|Jetfire[[Jetfire|Jetfire]]thumb|Jetfire[[Jetfire|Jetfire]]thumb|Jetfire[[Jetfire|Jetfire]]thumb|Jetfire[[Jetfire|Jetfire]]thumb|Jetfire[[Jetfire|Jetfire]]thumb|Jetfire[[Jetfire|Jetfire]]
Following the Battle of Egypt, Optimus and the Autobots began to assist the US in preventing human conflicts. Three years after the battle in Egypt, Optimus, N.E.S.T. and the Autobots traveled to Chernobyl, where they found a mysterious piece of a metal part before coming under attack by Shockwave's Driller. Optimus grabbed a sword and shield from his weapons pack and cut loose the piece of metal parts. Shockwave emerged from the Driller to glare at Optimus before fleeing with his pet. Optimus was shocked and enraged to discover that the mysterious piece of metal was an engine part of the long-lost Ark.
The Autobots returned to NEST with the part and Optimus remained in alternate mode at first as Charlotte Mearing approached him when he was angered. Optimus transformed and confronted Mearing about the part and the fact that they were told that everything humanity knew about the Cybertronians had been told. Mearing explained that it was kept secret from everyone except a very few people and brought in Buzz Aldrin to explain. After learning of the Ark being crashed on the moon, Optimus decided to take the Xantium to investigate the wreckage.
Optimus and Ratchet traveled to the moon and entered the Ark where they found Sentinel Prime in stasis lock with five of the Pillars, including the Control Pillar. They recovered the Pillars and Sentinel and returned to Earth with them.Upon their return to Earth, the Pillars were put into a vault under the human's control and Optimus prepared to use the Matrix of Leadership to revive Sentinel. After the arrival of Sam Witwicky, Optimus successfully revived Sentinel who initially attacked him, before calming down after learning where they were. The two then explained to the humans about the Space Bridge and the threat that would be posed if the Decepticons learned of it and got the Pillars.
Afterward, Optimus took Sentinel to show him some of the planets. Sentinel was impressed and Optimus offered him the Matrix of Leadership after lamenting what could have happened if Sentinel had led the final battle of the war. Sentinel refused the Matrix and told Optimus that he is now the teacher, not him.
Later, Optimus rushed back to the base after Sam discovered what the Decepticons were up to, but was too late as Sentinel revealed his true colors, murdered Ironhide, and took the Pillars.
At the National Mall in Washington, Optimus pleaded with Sentinel, who was using the Space Bridge to bring an army of hundreds of Decepticons to Earth, to stop. When that failed, Optimus attacked Sentinel but proved to be no match for the formal leader. Sentinel pinned him down and explained that he did what he did to save Cybertron before leaving, telling Optimus that he was lucky he didn't kill him and that he would one day understand.After Sentinel made an ultimatum to the United Nation, the Autobots were ordered expelled from the planet. Near the Xantium, Optimus met with a deeply saddened Sam who tried to get him to stay. Optimus informed Sam that they had to go and gave some words of wisdom to his old friend about not losing faith in yourself and that the war was the humans' now. Sam, under threat against his girlfriend, tried to find out the Autobots plans, subtly warning Optimus of the truth by telling him that no other human will ever know. Optimus told him that there was no plan and told Bumblebee to make his goodbye quick. Optimus and the other Autobots then left in the Xantium, which was destroyed by Starscream.
Optimus and the others abandoned the Xantium before its destruction and they headed to Decepticon-occupied Chicago to fight the Decepticons with the element of surprise. Optimus arrived just in time to shoot down a Decepticon fighter and save Sam, Epps and their team and ordered the Wreckers to kill the pilot. After making a speech about taking the fight to the Decepticons, Sam and Bumblebee took the downed fighter to rescue Carly and succeeded, killing Laserbeak in the process and hooking up with Optimus and the rest of the Autobots afterward.
Optimus and the other Autobots headed further into the city to open a way for Sam, Epps and their team to make their way to a building where they would attempt to shoot down the Control Pillar. Along the way, Shockwave and his Driller attacked, separating Optimus from his trailer. After linking up with the humans in a building, Optimus headed out to retrieve his trailer, needing the weapons and flight gear it contained.
Optimus successfully retrieved his trailer and flew it, in time to attack the Driller and save the team from death. Optimus shot the Driller multiple times before crashing through it, breaking it in half and killing it. Optimus landed on top of a crane where an enraged Shockwave blasted him, causing him to get tangled up in cables. Optimus was spotted by the Wreckers who quickly climbed up to cut him free.The Wreckers eventually cut Optimus free and he flew back into battle, killing several Decepticons before attacking Shockwave who was fighting NEST. Optimus slashed Shockwave across the torso with bladed knuckles and ripped his eye out, killing him. Seeing an opportunity, Optimus used Shockwave's cannon to blast the Control Pillar from the building it was on, temporarily deactivating the space bridge that was bringing Cybertron to Earth. Optimus challenged an enraged Sentinel to battle and fought him with the other Autobots, using a battle-ax and his sword, having the upper hand until Sentinel called upon the other Decepticons to attack them. Optimus was forced to turn his attention to the Decepticon fighters and shoot them down with his machine guns, allowing Sentinel to flee, although Optimus followed him.
Optimus quickly caught up with Sentinel on a bridge and attacked him again. Optimus held his own until Sentinel cut off his right arm and injured his left shoulder. As Sentinel was about to kill Optimus, he was attacked by Megatron who seriously wounded Sentinel, saving Optimus' life.
Megatron asked for a truce, saying all he wanted was to be in charge again and asked Optimus what he would be without him. Optimus responded with "Time to find out." and attacked Megatron. Even one-armed, Optimus was too much for Megatron and he impaled him on the head with his battle-ax, ripped off Megatron's head and spine, killing him. Sentinel then tried to explain to Optimus why he betrayed him, but Optimus coldly told Sentinel he betrayed himself before killing Sentinel with Megatron's fusion cannon.
Optimus then reunited with the humans and other Autobots and declared that they would never betray Earth, which is their new home with Cybertron destroyed.
Years later, Optimus Prime gains a new alt mode in that of a Western Star semi-truck.