In the episode Djinn & Water, Jeannie's 'master' (the series' canon intimates that Jeannie is in fact free to leave at any time) Major Anthony Nelson, USAF Pilot and NASA Astronaut, must tell a disappointed Jeannie that their 'anniversary' (the day Tony Nelson first found Jeannie) will pass with him attempting another space flight for NASA. Perhaps knowing to some extent that her obedience is purely voluntary, he makes her promise not to interfere with this flight. While the malfunction that occurs is not Jeannie's fault, her efforts do redirect him to the very island they first met, where her bottle is waiting to re-enact the event. Upset and believing that Jeannie broke her promise, Nelson finds a more ornate bottle, and thinking it is some sort of celebration gift, opens it. To his surprise, it is not Jeannie who emerges, but a blue-faced genie who he thinks will now obey him, but instead promises only to destroy him quickly, as 'thanks' for ending his captivity.
Attacked and panicking, Nelson runs and finds Jeannie's actual bottle, and opens it, thinking she will dispatch the evil attacker. But instead Jeannie panics as well, revealing that their foe is none other than the Blue Djinn, the very one who put her into her bottle for over a thousand years, as punishment for refusing to marry him. The couple flees to Nelson's home in Cocoa Beach, Florida, but the Blue Djinn finds them easily. Thinking quickly, Nelson grabs a television remote control, professing to be a powerful sorcerer. At first the Blue Djinn scoffs, till Nelson turns on his television and frightens the tech-ignorant Genie with images of armies, battles and more. Unfortunately, gadfly best friend Roger Healey walks in and quickly destroys the scam, putting them all in danger once again. Jeannie, in order to spare her beloved Tony, is willing to go with the Blue Djinn, but the three instead trick him into turning into smoke as he prepares to leave, sucking him up in a vacuum cleaner they then seal and toss into the middle of the ocean. Jeannie takes Tony back to the island, but their celebration is cut short by the Blue Djinn emerging from the ocean. Jeannie takes them back to Cocoa Beach, where they celebrate inside her bottle instead.
The Blue Djinn, perhaps fearing another humiliation, never appears again. However, his role in Jeannie's backstory was once even greater. In the series' first episodes, Jeannie was said to have once been a Human being, who was transformed into a Genie, and who mourned her long-dead mortal parents. It would have been that the Blue Djinn stalked her through all stages of her life, being the one who changed her so that he could have her for eternity. Later, though, Genie had been born of Genie parents, had a Genie sibling (also named Jeannie) and the Blue Djinn's role was merely as her captor. It is also possible that Jeannie, as a favorite of the ruling Genie, Hadji, was protected from any further wrath from the Blue Djinn.
Blue Djinn was played by the late Michael Ansara, who besides playing Klingon Captain Kang on Star Trek (TOS and DS9) and voicing Mister Freeze on Batman The Animated Series, also had the envy of many an American male by virtue of the fact that, while the Blue Djinn failed to get Jeannie, he at the time was married to Jeannie actress Barbara Eden.