Stardate 3156.2: Sulu and O'Neil are running down a street on an alien planet, being chased by… someone. Men in hooded figures wielding staves close in on them, as Sulu calls for transport. O'Neil panics and runs away, while one of the men touches Sulu with a staff just as he beams away. In the transporter room, Sulu claims he is now part of the Body and says the people on the planet knew them as "Archons," but the place is paradise.
Kirk notes that they are looking for the starship Archon, which disappeared a hundred years ago on the planet Beta 3. Kirk takes a new landing party down of Spock, McCoy, socialist Lindstrom, and two security guards. The natives are like Sulu, seemingly drugged and content. They run into one man who asks if they've come for Festival and directs them to a man named Reger who has rooms. He calls over Reger's daughter, Tula, but as the clock strikes six p.m., everyone on the streets goes berserk. The landing party makes a break for Reger's rooms and make it inside. Reger and two other men greet them, but one of them, Hacom, wonders why the landing party isn't part of Festival. Reger and the third man, Tamar, try to reassure Hacom but he goes off to report to the "Lawgivers" and their master, "Landru."
Reger gives them a room but is shocked when they say they have no intention of participating in Festival. Reger wonders who they are but leaves them. The landing party spend the night watching, and the next morning at 6 a.m. everyone goes back to normal. Tula arrives, injured and shocked, and Reger and Tamar try to reassure her. McCoy gives her a shot and Reger and Tamar believe that they are not part of the Body. Reger identifies them as Archons, saying it was foretold more would come. Hacom returns with two hooded Lawgivers and they casually kill Tamar. They then tell Kirk and the others that they will be "absorbed" into the Body, and speak of Landru being gentle.
When Kirk and the others refuse, the Lawgivers go immobile and seem to communicate with an outside source. The Lawgivers then restate the command and show a marked lack of initiative. Kirk then takes one of their staffs and Spock examines it, but it's simply an empty tube. The Lawgivers go immobile again, "communing," and Reger leads them out to a safe haven. However, the now-mindless populace advance on them and the landing party is forced to stun them. As they go by, they discover that O'Neil is one of them and they bring him along despite Reger's warnings. The native then takes them to an underground chamber and reveals a high-tech metal panel which gives off light. Reger says it comes from a time before Landru, as long as six thousands years. Reger says the Archons came and were either killed or absorbed.
Reger says that there are a few that oppose the Lawgivers, and he was part of a cell with Tamar and another man who only Tamar knew. Kirk orders McCoy to keep O'Neil unconscious since Reger warns that he can be used to find them. Reger then talks of Landru pulling the Archon down from the skies. As Spock has sensed nearby power readings, Kirk contacts the ship and Scotty confirms that they've been targeted by heat beams. They can maintain shields for protection but can't use their engines or beam them up, and will fall out of orbit in a few hours. Spock then picks up sensor beams and a projected image of an older man, Landru, appears before them. He speaks of peace and tranquility and ignores Kirk's response. A high-pitched noise then renders all of them unconscious.
The landing party wakes up in a cell without their equipment. Dr. McCoy and one of the security men are missing, and Spock concludes they're in a maximum-security facility. Spock notes that the Lawgivers reacted like a computer with insufficient programming. They're interrupted when the Lawgivers return with McCoy and the other security guard, in the same "absorbed" state as Sulu and the locals. The Lawgivers come for Kirk, but this time when he refuses they are "programmed" to kill him if he doesn't obey them. Kirk is taken to a chamber and a man, Marplon, comes to administer the absorption procedure.
The Lawgivers come and take Spock next, and as he is taken to the absorption chamber. As he enters, a smiling blissful Kirk greets him. Spock is then attached to the mechanism and Marplon activates the machinery but assures him that the procedure is harmless, but he was unable to save McCoy and the other. Marplon is the third man and says that their return is the fulfillment of prophecy and Reger will join them later as he's immune to absorption. He gives Spock their phasers and has him taken back to his cell. Kirk and Spock plan with Lindstrom while trying to avoid raising McCoy's suspicions. Spock concludes that the society is simply a machine and Landru is a computer. Kirk insists they must deactivate Landru and the Prime Directive doesn't apply.
Marplon and Reger arrive with their communicators but McCoy and the other security man attack them. Kirk and Spock subdue them and the two Lawgivers who come to investigate. Marplon and Reger start to have second thoughts but say Landru is heard in the Hall of Audiences. They contact Scotty who warns that they only have six hours, and have Sulu put under guard. Reger then explains that Landru brought the world back from the brink of self-destruction by taking them to a simpler time. They claim Landru is still alive and they have destroyed themselves. Reger panics and they're forced to knock him out, and Marplon reluctantly takes them to the Hall of Audiences, disguised as Lawgivers.
Once within the chamber, Landru appears before them and says they must be obliterated along with everyone who knows of them. The projection ignores them so Kirk and Spock use their phasers to burn a hole in the wall and find a massive computer. The computer identifies itself as Landru and neutralizes their phasers. Kirk points out that "Landru" is a machine and it exists to preserve the Body. The captain challenges it, pointing out that the Body is decaying under its care, and it is unable to answer. The Lawgivers are unable to function without Landru's faltering guidance, and the computer is unable to resolve the fact that its control is depriving the body of creativity. Kirk convinces it that it is the evil and it must destroy itself. It does so and the heat waves cut off.
Back aboard the ship, Kirk speaks with Lindstrom who is staying behind with a team of experts to help restore the planet's culture, and assures them that the people are acting normally for the first time in millennia. As the ship leaves orbit, Kirk notes that they were lucky to have never had a Paradise to become trapped in.