While passing the uninhabited planet Zeron II, the U.S.S. Enterprise's sensors pick up a strange energy discharge from the planet's surface. Which turns out to be the transportation of a mysterious figure to the bridge of the starship. He is a tall humanoid male with pale yellow skin, dark robes and a long metal staff. He calls himself the Traveler and says that he is "a wayfarer who's had his fill of wandering -- and want to go home!" The Traveler takes over the ship, shocking Scotty with his energy staff in the process. He intends to use it to go to his home planet. He causes the Enterprise's speed to increase dangerously but he also alters the ship's atomic structure to withstand the pressure of the great speed. Bones storms onto the bridge and demands an explanation.
The Traveler tells the tale of how his homeworld is a paradise and that over the centuries his people had embraced leisure to the extent that they stagnated, losing all ambition to improve. The Traveler explained that he wanted more from life and so left his home to find answers to the many questions of life. He traveled far and wide, witnessing new-born races struggle for survival, he spent time with age-old stellar mystics to learn their supernatural secrets, and he journeyed to see civilizations that were old before Earth's solar system formed. He even learned a teleportation technique from the Organians. But after seeing star systems die and galaxies crumble, he had grown weary and was ready for a rest. He admits that he would not have stolen the Enterprise if he'd had the energy to travel home by himself. Kirk has had enough, and just as he demands to have control of the ship restored to him, the starship arrives at the Traveler's home planet. The ship's crew are given control back, and as the black-clad visitor is about to depart, Spock stops him. "Nomad -- wait! Captain, I thought our mission was to seek out new life and civilizations -- and yet our Nomad is going home alone! I for one would like at least a glimpse of paradise!" McCoy chimes in as well. So, Kirk, Spock and Doctor McCoy accompany the Traveler down to the planet Utopia.
When they reach the planet surface they behold the aftermath of a great holocaust as the once great city is now only charred rubble. Just then, a man being chased and fired upon by a robot-driven portosled runs up. The man reaches them just as he is shot by an energy beam.
They drag the man to cover and then Nomad uses his energy staff to destroy the portosled after the Federation men's phaser fire fail to do so. The dying man tells them that Niklon is responsible for the recent carnage. Niklon, the Traveler's brother, has been responsible for running the robot production and programming facilities. Over the years, he had altered all robot controls so that they were under his command alone. When the people defied Niklon, their city was destroyed as an example. After finishing his tale, the man dies. The Traveler vows to stop Niklon's subjugation of the people and Kirk and company throw in with him. Kirk tries to call the Enterprise and then discovers that their communications are being jammed by Niklon.
The four travel to the City of the Thousand Lights aboard a flying carpet powered by the Traveler's multi-purpose energy staff.
Once in the city they approach the impressive government seat building and are soon surrounded and overpowered by Niklon's loyal robot guards. The guards take them to an audience with Niklon who is a bald, dwarf with pale yellow skin who sits upon a raised throne containing an impressive array of controls. Niklon proclaims that he took over because he was resentful that he was assigned to toil at making the robots that provided luxury to the people who enjoyed a labor-free existense. So he turned the tables - he now lived in luxury while all others toiled in the fields and sweated in the factories.
Niklon's tirade over, the Traveler and the Enterprise team are led away to the building's deep dungeon where they find many dozens of imprisoned citizens. Kirk, Spock, McCoy and the Traveler are placed in a cell guarded outside by a robot. After some moments, Spock gets an idea.
Later, McCoy calls to their guard from the door, "Guard! Guard -- Come quickly! We have a very sick man in here You have to help him!" When the robot touches the cell, it is short circuited in a blast of energy. Spock had wired the metal door handle to the cell's light fixture and then spilled water onto the floor so that when the robot touched the door it would complete the circuit. The door lock blown, the four dash out and quickly release the other prisoners. Right then and there, in the dungeon of the government seat building, they hatch a plan to take the fight back to Niklon.
Thinking quickly, Spock dresses himself in the deactivated robot guard's outer metal shell and then leads Kirk, McCoy and the Traveler back to Niklon's throne room. Niklon is aghast and questions the robot why he brought the prisoners back, when suddenly the recently liberated citizens storm in armed with sabers and begin to attack Niklon's robot minions. Niklon is stunned at the turn of events, but he has one more trick up his sleeve. Niklon works some controls, and the throne rises revealing that it is the top "head" portion of a giant 25-foot-tall robot.
The giant robot containing Niklon starts to mop up the place with the rebellious citizens. Spock, still disguised as a robot, acts quickly and retrieves the Traveler's energy staff from a robot guard and throws it to the Traveler who uses it to melt Niklon's giant robot suit.
Niklon is captured and he moans that all of his controls for the all of the planet's robots were in his throne which was destroyed with the giant robot. With Niklon's jamming devices gone, Kirk contacts the Enterprise. Scotty informs them that up until a moment ago, the starship had been locked in an iron grip of unknown origin. The Traveler bids his Enterprise comrades goodbye promising that his people will rebuild their paradise, but will never again become slaves of its luxury. back aboard the Enterprise as it speeds away from the planet Utopia, McCoy quips that the role of a robot suited Spock perfectly, to which Spock responds, "Why thank you Doctor - That's the first 'compliment' you've paid me in quite a long time."