The USS Enterprise is sent to observe Planet Nibiru, but finds a volcano on the verge of erupting and wiping out its primitive inhabitants. In the process of launching a dangerous mission to halt the eruption, first officer Spock’s life is jeopardized, forcing Kirk to break the “Prime Directive” and reveal the Enterprise to the planet’s civilisation to rescue him. As a consequence, a number of indigenous people begin to worship the ship as it leaves. After being called back to Earth, Kirk is relieved of command, and Admiral Pike reassumes command of the Enterprise. Shortly afterward, Starfleet agent John Harrison bombs a secret “Section 31” installation in London. An emergency meeting of high ranking officers is called at Starfleet headquarters, which Kirk attends as Pike’s first officer. The meeting is attacked by a gunship piloted by Harrison. Kirk takes the gunship down, but Harrison escapes and Pike dies.
After Pike’s funeral, Admiral Marcus (Weller) authorizes Kirk to hunt down Harrison, who has fled to the Klingon homeworld of Qo’noS. Since Qo’noS lies deep in Klingon territory and Starfleet is on the brink of war with the Klingon Empire, the Enterprise is supplied with 72 long-range prototype photon torpedoes, and is ordered to fire them all at Harrison’s location once he is found. Believing the torpedoes could be dangerous to the ship, chief engineer Montgomery Scott refuses to take them aboard and tenders his resignation when ordered to accept them. The Admiral’s daughter, scientist Carol Marcus also joins the crew, under a false identity, and Pavel Chekov is promoted to Chief Engineer.
After arriving at the Klingon homeworld, the Enterprise’s warp core malfunctions, leaving the ship stranded in space. With repairs underway, Kirk, Spock and Uhura use a previously commandeered trader ship to enter Qo’noS. However, they are detected by Klingon patrol ships and are forced to land. Despite Uhura’s attempts to negotiate, the Klingons prepare to kill the trio, when a mysterious figure attacks the Klingons. After wiping them out, John Harrison confronts the landing party, but surrenders after learning the precise number of torpedoes aimed at him.
Back on the Enterprise, Harrison reveals his real identity: Khan, a genetically augmented superhuman, who has been in cryo sleep for 300 years after waging an unsuccessful war on Earth to eradicate all those inferior to himself and his superhuman comrades. He suggests Kirk should take a closer look at the 72 prototype torpedoes and tells him a set of spatial coordinates. Kirk orders McCoy to take apart one of the torpedoes, and contacts Scotty back on Earth to examine the co-ordinates. The torpedoes are found to each contain a genetically-engineered human in cryo sleep – the remaining members of Khan’s crew from the Botany Bay. Khan explains that Admiral Marcus awakened Khan to force him to use his superior intellect and savagery to develop advanced weapons to start a war with the Klingons, keeping his crew as hostages. Kirk realizes that the Enterprise warp core has been sabotaged on Marcus orders, making the covert operation to kill Khan a one-way ticket. At the same time Scott arrives at the coordinates which have been revealed by Khan, and finds a secret Starfleet shipyard, which he infiltrates. Back on the Enterprise the defective warp core is brought back online, but Chekov discourages from using it yet. Shortly after, another ship arrives: an unregistered Federation battleship, the USS Vengeance – a massive vessel built for combat which dwarfs the Enterprise. Admiral Marcus reveals himself as the commander of the vessel, demanding Kirk hand over Khan. Kirk refuses, and the Enterprise warps away to Earth, to return Khan to stand trial for his crimes.
With Marcus in pursuit, the Enterprise is attacked by the Vengeance in Earth’s orbit. Outgunned, the Enterprise is severely damaged. Ultimately Kirk agrees to hand over Khan and the 72 bodies in cryo sleep in exchange for the lives of his crew. Marcus refuses and beams his daughter aboard to prevent her being used against him. As the Vengeance is about to destroy the Enterprise, it suffers a ship-wide power outage, caused by Scott who had boarded the ship earlier at the secret shipyard. As the Enterprise weapons are too damaged to continue the fight, and knowing that Khan was the designer of Marcus’ ship, Kirk allies himself with Khan and boards the enemy ship. They reunite with Scott and take the bridge. Meanwhile, Spock contacts Spock Prime to learn of Khan’s history and how to defeat him. Khan betrays Kirk and takes control of the ship, killing Admiral Marcus in the process. Khan negotiates with Spock for Kirk’s life, and beams aboard the 72 torpedoes onto the Vengeance. Khan beams Kirk and the rest of the boarding party back to the Enterprise in order to destroy it. Spock reveals that the torpedoes beamed to the Vengeance were armed, while the cryo pods still remain on the Enterprise. The torpedoes detonate, rendering the Vengeance non-functional, and sending Khan into a furious rage, believing his crew have been killed. Both ships start descending towards the Earth’s surface. The crew of the Enterprise manage to halt their ship’s descent, as Kirk sacrifices his life to re-align the warp core, dying from radiation poisoning. The enemy ship crashes into downtown San Francisco. Having survived the crash, Khan tries to escape in the chaos, but is pursued by Spock. Meanwhile, Doctor Leonard McCoy discovers that Khan’s blood may reanimate the dead Kirk. At the last possible moment, Uhura prevents Spock from killing Khan, and he is taken captive.
Kirk reacts positively to the treatment and is revived and put back on active duty. Khan is sealed into his cryo pod and stored away with the rest of his crew. As the film ends, the Enterprise is re-christened and departs for a 5-year mission of exploration.