In 2259, Captain James T. Kirk is removed from command of the starship USS Enterprise for violating the Prime Directive after exposing the ship to the primitive inhabitants of the planet Nibiru in order to save them, and Spock, from a cataclysmic volcanic eruption. Admiral Christopher Pike is reinstated as commanding officer with Kirk demoted to first officer. Spock is transferred to another ship. Shortly after, Starfleet operative John Harrison bombs a Section 31 installation in London. During an emergency meeting on the situation, Harrison uses a ship to ambush and kill Pike and other senior officers, before transporting to Kronos, homeworld of the hostile Klingons.
Admiral Alexander Marcus reinstates Kirk and Spock to Enterprise with orders to kill Harrison using a new long range stealth torpedo. Chief Engineer Montgomery Scott objects to allowing untested torpedoes on board without knowing their specifications; when he is overruled, he resigns. Kirk assigns Pavel Chekov to replace Scotty. En route to Kronos, Enterprise’s warp capabilities become disabled. Kirk leads a team with Spock and Uhura to the planet, where they are ambushed by Klingon patrols. Harrison appears and kills the Klingons. Harrison surrenders when he learns the precise number of torpedoes on board Enterprise.
Dr. Leonard McCoy and Marcus’s daughter, Dr. Carol Marcus, open a torpedo at Harrison’s urging, revealing the torpedoes contain cryonically-frozen humans. Harrison is taken to Enterprise’s brig, where he reveals his true identity as Khan Noonien Singh, a genetically engineered superhuman, awoken by Admiral Marcus from centuries of sleep and forced to develop advanced weapons. Khan reveals that Marcus sabotaged Enterprise’s warp drive, intending for the Klingons to destroy the ship after it fired on Kronos, sparking war with the Klingon Empire. Khan also gives Kirk a set of coordinates, which Kirk asks Scott to investigate. Scott discovers the coordinates lead to a covert Starfleet facility.
Enterprise is intercepted by a much larger Starfleet warship, USS Vengeance, commanded by Admiral Marcus. Marcus demands that Kirk deliver Khan, but Enterprise flees to Earth to expose him. After Vengeance disables Enterprise near the Moon, Carol reveals her presence aboard Enterprise to stop the attack. Marcus forcibly transports Carol to Vengeance before ordering Enterprise’s destruction. Vengeance loses power after being sabotaged by Scott, who infiltrated the ship. With transporters down, Kirk and Khan, with the latter’s knowledge of the warship’s design, space-jump to Vengeance. Khan overpowers Kirk, Scott, and Carol, kills Marcus, and takes control of Vengeance.
Khan demands that Spock return his frozen crew in exchange for the Enterprise officers. Spock complies, but surreptitiously removes Khan’s frozen crew from the torpedoes and detonates the warheads, crippling the ship. With both starships caught in Earth’s gravity, they plummet toward the surface. Kirk enters Enterprise’s radioactive reactor chamber to realign the warp core, sacrificing himself to save the ship.
Khan crashes Vengeance into downtown San Francisco in an attempt to destroy Starfleet headquarters, while McCoy discovers that Khan’s blood has regenerative properties that may save Kirk. Spock pursues Khan through the city and the two engage in hand-to-hand combat. Uhura beams down and stuns Khan, Spock then gains the upper hand and is about to kill Khan, but Uhura stops him. Khan’s blood revives Kirk. One year later, Kirk speaks at Enterprise’s re-dedication ceremony. Khan is sealed in his cryogenic pod and stored with his compatriots. The Enterprise crew embarks on a five-year exploratory mission.