The Enterprise is on a mission to explore the Delta Triangle, an uninhabited sector of space where ships have been disappearing for hundreds of years. As they enter the Triangle, a Klingon battlecruiser, the Klothos, opens fire on them. Sulu returns fire and much to everyone's surprise, the Klothos disappears without a trace. Spock confirms that their phasers did minimal damage and that the Klingons didn't use their cloaking device. He suggests that whatever has been causing other ships to disappear worked on the Klothos as well.
Realizing that it's a trap, Kirk has Sulu scan the area. Two more Klingon ships are closing in and Commander Kuri hails the Enterprise. Before he responds, Kirk tells Sulu to chart a course through the coordinates where the Klothos disappeared. He then addresses Kuri, who blames the Enterprise for destroying the Klothos. Kirk points out that they are in the Delta Triangle but Kuri isn't interested and Kirk signs off. The two Klingon ships open fire and the Enterprise shields hold long enough for them to get to the last coordinates of the Klothos. As the shields give out, the Enterprise suddenly disappears...
... and reappears in a starless void. Surrounding them are hundreds of spaceships from dozens of different races and eras. Spock confirms that many of them are ones that were reported as missing in the Delta Triangle. Spock suggests that they are in an alternate universe, one which briefly touches their universe on an inconsistent basis. The portal that swallowed the Klothos stayed open long enough for them to follow through rather than face death at the hands of the Klingons. As they scan for the Klothos, Spock informs Kirk that some of the spaceships are centuries old. Also, some of them have life and energy readings, and those are gathered in a cluster ahead of them.
Kirk's old enemy Commander Kor is aboard the Klothos and waiting patiently to ambush the Enterprise. When they move forward to get a clear shot, the Enterprise crew spots them. Kor gives the order to fire... but the ship's weaponry freezes. The same thing happens aboard the Enterprise when they try to return fire. As Sulu tries to get the controls to work, Kirk disappears in a transporter beam.
Kor is transported into a council chamber, surrounded by individuals from a dozen different races. He tries to draw his disruptor pistol but the council leader, a Romulan named Xerius, burns Kor's hand with a gesture. Kirk arrives a second later and Xerius welcomes them to their nation of Elysia. He calls upon an Orion woman, Devna, to speak as the interpreter of their laws. Devna explains that Elysia is made up of races from 123 different planets, some of them having been there for thousands of years. Although some were enemies in the outside universe, they have all learned to live together because they have no choice. The law forbids any acts of violence and the Elysia Council punishes anyone who disobeys.
Kor wonders how the council nullified their weapons and Xerius explains that they have a number of races with psionic powers among them. Anyone who violates the anti-violence laws has their ship immobilized for a century. Kor points out that they'll be long dead by then and Xerius tells him that within the pocket universe, time passes at a much slower race. All of the people present are hundreds of years old. Some of them have tried to escape in the past, but they have learned that departure is impossible.
When he is returned to the Enterprise, Kirk briefs Spock and Scotty on the situation. He vows to get out, and Scotty warns him that they'll have to do it quickly. Some property in the pocket universe is deteriorating their dilithium crystals, and they'll be without power in four days. Kirk puts Spock to work running the formula and finding a way out.
On the Klothos, Kor's first officer Kaz tells his captain the same thing.
Xerius and Devna have one of their psychics, Magen, read the thoughts of the two new crews. She informs her friends that both crews are trying to escape. Devna points out that they all sought to do the same thing at one time or another, and believes that only when Kirk and Kor try their hardest and inevitably fail will they accept their fates.
Spock informs Kirk that his calculations show no chance of their escaping the pocket universe. They watch as the Klothos makes a run at top speed at the borders of the universe. Spock notes that the Klothos has the same type of engines that they do, and are doomed to fail. The Klothos bounces back and Kirk admits that he wishes that they had succeeded, just to show that it was possible. Spock gets an idea and returns to his calculations. He then shows the command crew his formulas, and Scotty realizes that it requires two starships, acting in tandem. Kirk points out that they have no other choice and goes to contact Kor, while Scotty and Sulu begin preparations on the assumption the Klingons will agree.
Magen continues her telepathic monitoring and tells Xerius and Devna of the new plan. Devna fears that the two new crews will endanger themselves, but Xerius refuses to interfere as long as they obey the laws against violence.
Kirk and Spock travel to the Klothos to present Kor and Kaz with their plan. Kor immediately agrees and a surprisingly friendly Spock goes over to the two Klingons, embraces them, and thanks them for their spirit of cooperation. Once he leaves with Kirk, Kor dismisses Spock as insane because of his half-human nature. Kaz wonders why Kor is working with his hated enemy, and the captain notes that it shouldn't come as a surprise if the Enterprise disintegrates shortly after they pass through the barrier. Kor tells Kaz to prepare something to make sure that happens and the first officer says that he can do it.
The two ships link, the Enterprise secondary hull to the Klothos' upper section. As the two crews work together, Gabler brings two Klingons to the bridge and tells Kirk that a security team found them near the dilithium vault. The Klingons insist that they were simply loss and Spock comes over, embraces both of them, and assures Kirk that it's an innocent mistake. While Spock takes them to their designated work area, McCoy points out that Spock is acting rather unusual. Kirk agrees but points out that they have no choice but to rely on Spock, but agrees to talk to him later.
When Spock reviews the progress of the joint operation, Kirk hints that he has been acting unusual and how everything comes down to the Vulcan's calculations. Spock explains that he used the two hugs to do a light mind-meld with the Klingons. He has learned that they are planning some way to eliminate the Enterprise, but was unable to get details. Kirk puts security teams on 24-hour watch at all vital areas to make sure the Klingons don't engage in sabotage.
Kaz finishes his capsule- explosive device and informs Kor that it will trigger a detonation in the Enterprise's warp core three minutes after they pass through the barrier. Kor gives the device to a female officer, Kali.
That night, the Enterprise hosts a party aboard the ship for the Elyisans and the Klingons. Devna performs an Orion dance for the crowd. Afterward , she admits to Kirk that she misses her homeworld. The captain offers to take her back, but Devna says that she has accepted her life in Elysia after her own ship's escape attempt failed. Meanwhile, McCoy invites Kali to dance and Kaz feigns outrage. As Kali slips away, unobserved, Kaz goes for his disruptor pistol. Xerius freezes the weapons and orders the two officers and their commanders to go to the council chamber to face charges. Meanwhile, Kali slips the explosive device into the warp control panel in the computer room.
The Elysian Council gathers and Xerius declares Kor and Kaz guilty of violating the law. When he prepares to freeze the Klothos for a century, Kirk speaks up, pointing out that doing so would punish his people as well by preventing their one chance of escape. The Romulan is surprised that Kirk would speak up for his enemy, but Kirk insists that they have no choice if they wish to escape. He concedes that Elysia may be a perfect place, but it's not home. Xerius releases Kor into Kirk's custody and wishes both commanders good luck.
With time running out, the two ships begin their joint maneuver. As they accelerate, Magen continues her telepathic monitoring and picks up Kor's plan. She tells Xerius, who contacts Kirk. Kirks ends Spock and Scotty to the computer room while the two ships approach the barrier. As they pass through into their universe, Spock finds the device and ejects it into space. The explosive goes off harmlessly as the two ships go their way. Kor contacts his superiors and takes full responsibility for escaping the pocket universe. Kirk and the others pick up the transmission, but Kirk tells McCoy that it doesn't matter as long as they're free.