The Federation starship USS Enterprise has been ordered to Sigma Iotia II, where the exploratory vessel Horizon was reported missing 100 years earlier.
First Officer Spock notes that their interference in the planet's development could violate the Prime Directive, but Captain Kirk points out that the Horizon's arrival a century ago would have already contaminated the culture.
Okmyx demands the Enterprise crew supply his gang with "heaters" (phasers, which was also American crime underworld slang for handguns), and when Kirk refuses, threatens to kill them.
McCoy and Spock flee to a radio station to contact the Enterprise and transport back to the ship, while Krako's men capture Kirk.
Kirk offers a peaceful solution, but Krako refuses and confines him, threatening to kill him by slow torture if he doesn't cooperate.
Taking suits and hats from Okmyx's men, Kirk and Spock return to Krako's office and gain entrance with the help of a local child.
Kirk installs Okmyx as the top boss with Krako as his lieutenant, and states that a Federation ship will come by once a year for their 40% cut of the planet's "action".