In 2286, an enormous cylindrical probe moves through space, sending out an indecipherable signal and disabling the power of every ship it passes. As it takes up orbit around Earth, its signal disables the global power grid and generates planetary storms, creating catastrophic, sun-blocking cloud cover. Starfleet Command sends out a planetary distress call and warns all space-faring vessels not to approach Earth.
On the planet Vulcan, the former officers of the late USS Enterprise are living in exile. Accompanied by the Vulcan Spock, still recovering from his resurrection,[a] the crew—except for Saavik, who remains on Vulcan—take their captured Klingon Bird of Prey (renamed the Bounty, after the Royal Navy ship) and return to Earth to face trial for their actions. Receiving Starfleet's warning, Spock determines that the probe's signal matches the song of extinct humpback whales, and that the object will continue to wreak havoc until its call is answered. The crew uses their ship to travel back in time via a slingshot maneuver around the Sun, planning to return with a whale to answer the alien signal.
Arriving in 1986, the crew finds their ship's power drained by the time travel maneuver. Hiding the Bounty in San Francisco's Golden Gate Park using its cloaking device, the crew split up to accomplish several tasks: Admiral James T. Kirk and Spock attempt to locate humpback whales, while Montgomery Scott, Leonard McCoy, and Hikaru Sulu construct a tank to hold the whales they need for a return to the 23rd century. Uhura and Pavel Chekov are tasked to find a nuclear reactor, whose energy leakage can be collected and used to re-power the Klingon vessel.
Kirk and Spock discover a pair of whales in the care of Dr. Gillian Taylor at a Sausalito aquarium, and learn they will soon be released into the wild. Kirk tells her of his mission and asks for the tracking frequency for the whales, but she refuses to cooperate. Meanwhile, Scott, McCoy, and Sulu trade the formula of transparent aluminium for the materials needed for the whale tank. Uhura and Chekov locate a nuclear powered ship, the aircraft carrier Enterprise. They collect the power they need, but are discovered on board. Uhura is beamed out but Chekov is captured, and subsequently severely injured in an escape attempt.
Gillian learns the whales have been released early, and goes to Kirk for assistance. Gillian, Kirk, and McCoy rescue Chekov from a nearby hospital and return to the now recharged Bird of Prey. After saving the whales from poachers and transporting them aboard, the crew returns with Gillian to their own time. On approaching Earth, the Bounty loses power due to the alien probe, and crash-lands into the waters of San Francisco Bay. Once released from near-drowning, the whales respond to the probe's signal, causing the object to reverse its effects on Earth and return to the depths of space. For their part in saving the planet, all charges against the Enterprise crew are dropped, save one for disobeying a superior officer, which is solely levelled at Admiral Kirk. Kirk is demoted to the rank of Captain and returned to the command of a starship. Kirk and Gillian part ways, as she has been assigned to a science vessel by Starfleet. The crew departs on their ship, the newly christened USS Enterprise (NCC-1701-A), and leaves on a shakedown mission.
William Shatner portrays Admiral James T. Kirk, former captain of the Enterprise.
Leonard Nimoy plays Spock
DeForest Kelley portrays Doctor Leonard McCoy
On Earth McCoy was paired with engineer Montgomery Scott (James Doohan), as producer Harve Bennett felt that Kelley worked well with Doohan's "old vaudeville comic". The other members of the Enterprise crew include George Takei as helmsman Hikaru Sulu, Walter Koenig as Commander Pavel Chekov, and Nichelle Nichols as Uhura.
Catherine Hicks plays Dr. Gillian Taylor, a cetologist on 20th-century Earth.
Majel Barrett reprises her role as Christine Chapel, the director of Starfleet Command's medical services.
The film contains several cameos and smaller roles. Alex Henteloff plays Dr. Nichols, plant manager of Plexicorp. Madge Sinclair makes an uncredited appearance as captain of the USS Saratoga (the first female Federation starship captain to appear in Star Trek). Musician Jane Wiedlin and tennis player Vijay Amritraj appear as Starfleet officers seen briefly on video screens at Starfleet Command. John Schuck appears as a Klingon ambassador, Robert Ellenstein as the Federation President, Michael Berryman as an alien display officer at Starfleet Command, and Brock Peters as Fleet Admiral Cartwright. Grace Lee Whitney reprises her role as Janice Rand from the original television series
based on the television series Star Trek. It is the fourth feature installment in the Star Trek franchise, and is a sequel to Star Trek III: The Search for Spock (1984); it completes the story arc begun in Star Trek II: The Wrath of Khan (1982) and continued in The Search for Spock.