Penny finds a pretty gold bottle after a meteor shower. The next day, the family go out to check the equipment for damage. While repairing a drill, Will and Smith are confronted by a very striking thief. The thief introduces himself as Sheik Ali ben Bad, and brags that he is the best thief in all of outer space. He summons forth a large slave who grabs Smith and Will. Ali demands they hand over their treasure, but when Will tells him they are poor and have none, the thief frees them. Will tells Ali that he and Smith are all alone on the planet, and the thief and his slave vanish.
Will tells his family what happened, but they do not quite believe him, especially Penny, who makes fun of him. Later Will goes out exploring for evidence to prove his story true. He finds a strange, sedan chair-like vehicle, and gets inside. He is then transported through space to an asteroid where the thief and his slave live.
The slave catches Will and hides him away in a furnace room, threatening to feed him to lions unless he does the slave's work in keeping the furnace running. Meanwhile, the Robinsons wonder about the strange celestial body orbiting their planet and the absence of their son.
Ali ben Bad finds out that his slave has been hiding Will. He treats Will decently enough, giving him food and making him an assistant. The thief explains to Will that he is seeking a very special magical treasure, a princess who had been kidnapped long ago. The device he uses to track her has led him to the Robinsons' planet.
The thief visits the Robinsons and asks who they are, but Will lies and says they are not his family; they are his enemies. Penny arrives on the asteroid, and Smith shortly thereafter. Penny is forced to work in the furnace room, and Smith is tied to a board under a swinging pendulum blade. The thief demands Smith tell him where the princess is, but Smith is terrified and truthfully says he does not know.
Will and Penny come up with a way to trick Ali, claiming John Robinson has a treasure map which might have made the locator device indicate a treasure. The thief believes them and the three of them go down to the planet. As this is happening, the slave rescues Smith, believing the doctor to be his former master, an evil vizier. Smith goes along with it, thinking he will get wealth and power.
The children’s plan works, and the thief himself is captured. He finds out the treasure map is a fake, and is quite upset until Smith distracts him by showing up dressed as the vizier. Smith commands his new slave to kill the thief. The slave is destroyed by one of Ali's rings, and the thief is about to kill Smith when he recognizes the golden bottle Penny found. It turns out the princess is trapped inside. Unfortunately for Ali, though, it turns out thta the princess has grown fat, lazy, and whining, and he beats a hasty retreat.
- Although some sources give the episode title as "The Thief of Outer Space", the episode identifies itself as "The Thief from Outer Space"
- The writer Jackson Gillis had a very varied career - here writing a campy fantasy and yet later going onto writing complex adult crime dramas for the Peter Falk series Columbo ("Suitable for Framing"),
- Ted Cassidy, who played the slave, also played Lurch in "The Addams Famlly," and he also played Ruk, in the Star Trek episode, "What Are Little Girls Made of."
- Malachi Throne played the Sheik Ali Ben Bad.
- Robot claims he “removed his lower tread section” in order to fit into the sedan chair. How did he do that all on his own and without any tools?
- How did Will avoid having to kill Penny?
- Why aren’t Penny and Will more concerned about Smith being sliced in two?
- When talking to the Princess, the Robot claims he is “not programmed for emotional entanglements.” However, in the episode ‘Deadliest of the Species,’ he gets very emotionally entangled.
- Why is John wearing a parka if it is so hot outside?
- When Will finds the treasure there’s no table, then viola the table appears