Optimus Prime is the Autobot leader in the Dark of the Moon film.
Optimus Prime first appeared at the abandoned Chernobyl area, in which he and several other Colonel William Lennox encountered Shockwave and his pet Driller. While there - Prime found a piece of what he confirmed as being part of their long-lost Autobot ship.
Back at the Nest Base, Optimus refused to transform out of his vehicle mode - until finally, he did so - yet threw all of his anger out at Charlotte Mearing, asking why the the Cybertronian material was found in human's hands - and Prime than remembered how Sentinel Prime was on the ship that crashed, and decided to fly on the Xantium to the Moon.
At the Moon itself, Optimus, Ratchet and Bumblebee found the ship, as well as the corpse of Sentinel Prime, which they were successful on bringing back to Earth. There, using the Matrix of Leadership, Optimus revived Sentinel, and drove to unidentified areas and spoke to him about what has happened, and soon, offered him the Matrix - though Sentinel denied it. Meanwhile, Sam discovered that the Decepticons were planning for the Autobots to revive Sentinel Prime and retrieve the Pillars.
As Sentinel seemingly speeds ahead of Optimus, the Autobots protect him on a highway while battling Crankcase HatchetCrowbar, and killing all three of them soon after. However, upon arriving at Nest HQ to hide Sentinel - Sentinel himself betrays the Autobots, kills Ironhide, wrecks the Headquarters and escapes with the Pillars. Optimus arrives in horror of the destruction. Later, Optimus finds Sentinel in front of the National Mall and battles him after he activates the Pillars and releases hundreds of Decepticons and Ships to Earth.
Optimus is among the Autobots exiled from Earth, and are taken away on the Xantium - yet manage to escape just as Starscream destroys the ship, and Optimus later brings down a Decepticon ship seconds before it could shoot Sam and Epps. The Autobots are now united as they head into Chicago.
As they arrive into the city, Shockwave and his Driller pet appear, uncuppling Optimus and his Trailer. Optimus later retrieves it and uses it as a jetpack, which he uses to battle and kill the Driller by severing it's "head" - yet is blasted by Shockwave into a crane's wires, and is luckily freed by Topspin RoadbusterLeadfoot and he later battles and kills Shockwave by ripping out his single eye. Prime than partially deactivates the Control Pillar.
Optimus than battles Sentinel, whom, after a long battle, tears off his right arm and injures his left shoulder. Moments before Sentinel could kill him - Megatron viciously attacks him, having found out that Sentinel would soon have all the power. After severely wounding him, Megatron asks Optimus for a truce - yet only if he could remain in charge, and asks him who he would be without him. Optimus denies the truce, seeing that Megatron wasn't exactly going to give in so easily - and, even with one arms, jams his axe into Megatron's head and tears both his head and spine out, killing the tyrant forever.
Optimus than says that Earth will have to be their new home, due to the destruction of Cybertron.
- Optimus Prime (2011)