The Federation Starship Enterprise limps back to Earth following a battle with the genetically engineered superhuman Khan Noonien Singh, who tried to destroy the Enterprise by detonating an experimental terraforming device known as Genesis. The casualties of the fight include Admiral James T. Kirk’s Vulcan friend, Spock, whose casket was launched into orbit around the planet created by the Genesis Device, where it eventually lands on the planet’s surface. On arriving at Earth Spacedock, Doctor Leonard McCoy begins to act strangely and is detained. Starfleet Admiral Morrow visits the Enterprise and informs the crew the ship is to be decommissioned; the crew is ordered not to speak about Genesis due to political fallout over the device.
David Marcus (Merritt Butrick)—Kirk’s son, a key scientist in Genesis’ development—and Lieutenant Saavik (Robin Curtis) are investigating the Genesis planet on board the science vessel Grissom. Discovering an unexpected life form on the surface, Marcus and Saavik transport to the planet. They find that the Genesis Device has resurrected Spock in the form of a child, although his mind is not present. Marcus admits that he used unstable “protomatter” in the construction of the Genesis Device, meaning that Spock is rapidly aging and the planet will be destroyed within hours. Meanwhile, Kruge (Christopher Lloyd), the commander of a Klingon vessel, intercepts information about Genesis. Believing the device to be a potential weapon against the Klingons, he takes his cloaked ship to the Genesis planet, destroys the Grissom, and captures Marcus, Saavik, and Spock.
Spock’s father, Sarek (Mark Lenard), confronts Kirk about his son’s death. The pair learn that before he died, Spock transferred his katra, or living spirit, to McCoy. Spock’s katra and body are needed to lay him to rest on his homeworld, Vulcan, and without help McCoy will die from carrying the katra. Disobeying orders, Kirk and his officers spring McCoy from detention, disable the USS Excelsior, and steal the Enterprise from Spacedock to return to the Genesis planet to retrieve Spock’s body.
In orbit, Enterprise is attacked and disabled by Kruge. In the standoff that follows, Kruge orders that one of the hostages on the surface be executed; David is killed defending Saavik and Spock. Kirk and company feign surrender and activate the Enterprise ’s self-destruct sequence, killing the Klingon boarding party while the Enterprise crew transports to the planet’s surface.
Promising the secret of Genesis, Kirk lures Kruge to the planet and has him beam his crew to the Klingon vessel. As the Genesis planet disintegrates, Kirk and Kruge engage in hand-to-hand combat; Kirk emerges victorious after kicking the Klingon into a lava flow. Overwhelming the last member of the Klingon crew, Kirk and his officers set course for Vulcan.
Spock’s katra is reunited with his body in a dangerous procedure called fal tor pan. The ceremony is successful and Spock is resurrected alive and well, though his memories are fragmented. At Kirk’s prompting, Spock remembers he called Kirk “Jim” and recognizes the crew.