<P> Infiltrating K.S.I.'s headquarters in Chicago, Cade discovers the remains of Autobots and Decepticons are being melted down to make the drones . Joshua Joyce, the ambitious company CEO, is in league with Attinger to revolutionize global defenses and improve human society using the Seed . He has captured Brains and is using him and Megatron's head to create prototype Transformer soldiers Galvatron and Stinger . In a fit of rage, the Autobots storm the building, during which Bumblebee regains his original form by scanning a passing car, where they rescue Brains and destroy the laboratory, but they soon leave after Joshua announces that they are no longer needed . Attinger forces Joshua to deploy Galvatron and Stinger to attack the Autobots . During the battle, Galvatron's behavior becomes slightly erratic when he starts destroying vehicles . As Galvatron battles Optimus, it frees itself from control and speaks to Optimus . Lockdown then arrives and abducts Optimus while Galvatron and Stinger retreat; Tessa is inadvertently captured alongside Optimus in the midst of the chaos, leaving Cade and Shane devastated . </P> <P> While Lockdown's large prison spacecraft hovers over Chicago to hand over the Seed, Cade, Shane, and the Autobots use this opportunity to sneak on board and rescue Optimus and Tessa . They hijack a smaller ship, containing a number of other Autobots called the Dinobots, just before Lockdown leaves Earth . The Autobots reveal to Cade that "Galvatron" is in fact Megatron, who had transferred his consciousness into the Galvatron drone after K.S.I. officials had accidentally revived him . They realize that Galvatron is plotting to use the Seed and the K.S.I. drones to conquer the world, by detonating the Seed in Hong Kong, as K.S.I. has brought it there to use it in the remote Mongolian desert to create vast amounts of usable Transformium . Cade informs Joshua of Megatron's presence, causing him to have a change of heart and agreeing to hand over the Seed with help from Darcy and his Chinese business associate Su Yueming . Meanwhile, Lockdown discovers that Optimus has escaped and stole a part of his ship, forcing him to return to Earth to retrieve them . Optimus decides for the Autobots to no longer help the humans because of how they revived Megatron, but Cade explains to Optimus why something unintentional is not a reason for him to lose faith in them . Back at the facility, Joshua gets into a disagreement with Attinger over the Seed, threatening to expose Attinger's nefarious activities, whilst Attinger deduces Joshua's plot to betray him . Galvatron unexpectedly reactivates himself and promptly takes control of the K.S.I. drones, and a battle follows in Hong Kong's streets between Cade's group, the Autobots, Cemetery Wind, Galvatron, and his drones . During the fight, Optimus gains the alliance of the Dinobots, who become essential to the Autobots' victory while Bumblebee kills Stinger . </P> <P> Lockdown returns to capture Optimus and the Dinobots, using a large magnet in his ship that picks up and drops metal objects, causing destruction to the city . After disabling the magnet, Optimus fights Lockdown at an abandoned factory . In the ensuing duel, Optimus kills Attinger (who still angrily deems all Cybertronians aside from Lockdown as a threat) to save Cade, and avenging the deaths of his fellow Autobots . However, this allows Lockdown to pin Optimus down by impaling his chest with his own sword, damaging his spark . Cade, Bumblebee, Tessa, and Shane fight Lockdown, with Cade ending up fighting him one - on - one while Tessa and Shane use a tow truck to free Optimus, who kills Lockdown before using one of his grenades to finish off the remaining drones . Galvatron retreats, vowing to return . As Lockdown's ship leaves Earth, Optimus tells the Autobots to protect the Yeagers (with Joshua offering to help the Yeagers build a new home) and lets the Dinobots go, before flying away into space with the Seed to hide it away, sending a message to the Creators that he is coming for them . </P> <Ul> <Li> Mark Wahlberg as Cade Yeager A single father and struggling inventor . </Li> <Li> Stanley Tucci as Joshua Joyce The ambitiously arrogant head of KSI who wants to build his own Transformers . </Li> <Li> Kelsey Grammer as Harold Attinger A paranoid CIA operative and government official who created the CIA black - ops unit, Cemetery Wind to eliminate all Transformers, Autobot or Decepticon, from Earth . </Li> <Li> Nicola Peltz as Tessa Yeager Cade's daughter who is secretly dating Shane . </Li> <Li> Jack Reynor as Shane Dyson Tessa's boyfriend and an Irish rally car driver . </Li> <Li> Titus Welliver as James Savoy A ruthless CIA Agent and second - in command of the Cemetery Wind working for Attinger . </Li> <Li> Sophia Myles as Darcy Tirrel Joshua's geologist assistant and ex-girlfriend . </Li> <Li> Li Bingbing as Su Yueming (苏月明 Sū Yuèmíng) The owner of the Chinese factory used by KSI to build their artificial Transformers . </Li> <Li> T.J. Miller as Lucas Flannery Cade's best friend and a mechanic . </Li> <Li> James Bachman as Gill Wembley A scientist working with Joshua Joyce at KSI . </Li> <Li> Thomas Lennon as the Chief of Staff . </Li> </Ul>

What happened to optimus prime at the end of age of extinction