It was written by series creator Sidney Sheldon and directed by Gene Nelson, and originally aired on NBC on September 18, 1965.
When his final stage misfires, his one-man capsule, Stardust One, is unable to maintain orbit and he has to make an emergency landing on a desert island in the South Pacific.
When he opens it, smoke pours out, and a 2000-year-old beautiful blonde-haired girl named Jeannie (Barbara Eden) appears, dressed in harem clothing and speaking in Persian (in the unaired version of the episode, her first words to him are translated on screen as,"Your wish is my command, Master"), and gratefully kisses him.
After it lands nearby, Tony realizes he can't take Jeannie with him; not only can't he explain her presence logically, it's left unsaid she would also complicate matters with the fiancee he is about to marry, Melissa Stone (Karen Sharpe), the daughter of his commanding officer.
He says goodbye, and heads for home; but he doesn't see that the girl, smoking inside her bottle, rolls it into his duffel bag and returns to Cocoa Beach, Florida with him.
Upon his return to Cape Kennedy, Tony is debriefed by the base psychiatrist, Col. Alfred Bellows (Hayden Rorke).
Nelson, the doctor, worried about Tony's mental health, immediately phones his superior, Gen. Wingard Stone (Philip Ober).
Bellows brings up the matter of Tony's hallucination, claiming he can't reinstate him for active duty until he's certain he's "completely normal".
In a panic, Tony quickly races to the truck, offers the garbage men $10 for the contents, and fishes out the bottle.
Just as Dr. Bellows is about to phone for an ambulance, Tony suddenly giggles, telling them the whole incident was "just a gag", that he was just getting back at Roger and Pete for what they did to him while in training.
The episode is over, but not the battle of the sexes between her and Tony, as he reluctantly accepts the fact he's now "master" of a beautiful but stubborn genie who knows what's best for him.