Caught in the beginnings of an ion storm, Kirk, McCoy and Uhura interrupt their negotiations with the Halkans for dilithium crystals, to return to the U.S.S. Enterprise. Scotty beams the landing party aboard as a burst from the storm hits the starship. The transporter malfunctions, sending Kirk, McCoy, Scotty and Uhura into an alternate universe. In this world, they soon discover the "Galactic Empire" is maintained by fear and assassination. Now, aboard the Imperial Starship Enterprise, the four must find a way to remain undetected until they can return to their own universe.
Meanwhile, the parallel versions of Kirk, Scott, McCoy and Uhura have been beamed on board the positive U.S.S. Enterprise. Their behavior is so different from their counterparts that Spock immediately realizes something is wrong. He had the four imprisoned until the transporter could be checked and repaired.
On the I.S.S. Enterprise, the parallel Chekov is foiled in an attempt to assassinate Kirk. When Kirk refuses to give an order to destroy the Halkans, who have refused to give up their dilithium crystals, the parallel Spock becomes suspicious.
The Imperial Fleet sends a secret message to the parallel Spock, telling him to kill Captain Kirk and assume command of the starship. Finding an unexpected ally in the parallel Spock, Kirk continues to stall while his three comrades gather the information needed to send them back to their own universe.
Parallel Spock has no desire to become captain, and therefore a mark for assassination. Along with Lieutenant Marlena Moreau, who wants the parallel Kirk back because she is "the Captain's woman," they help return the four U.S.S. Enterprise officers to their own world. Before he goes, Kirk talks to the bearded Spock, telling him the advantages of a Federation-like system over the anarchy of this universe. Spock seems almost convinced that he should in fact get rid of his Kirk, seize control of the I.S.S. Enterprise, and manipulate the Imperial Starfleet into working toward a more civilized universe.