Plot
In 1127, a djinn asks a Persian emperor to make his second wish. When the emperor wishes to see wonders, the Djinn uses his powers to torture and mutilate people in the palace. The emperor is horrified, but the Djinn tells him to use his third wish to set things right. Before the emperor can make his third wish, a sorcerer explains the consequences of the third wish, as it will free legions of djinn on Earth. He then reveals a fire opal, which pulls the Djinn inside and traps him.
In present-day America, Raymond Beaumont supervises workers lowering a large crate containing an antique statue of Ahura Mazda onto a ship. The crane operator, Mickey Torelli, is drunk and drops the crate, killing Beaumont's assistant Ed Finney and destroying the statue. A dockworker steals the fire opal from the rubble and pawns it. Eventually, the jewel reaches Regal Auctioneers, where Nick Merritt instructs appraiser Alexandra "Alex" Amberson to examine it, which wakes the Djinn. Alex sees something inside the jewel and leaves it with her close friend and colleague, Josh Aickman, to analyze. As he collects data, the gem explodes, destroying the lab and releasing the Djinn. Josh, wounded, wishes for relief from his physical pain, and the Djinn grants his wish by killing him.
Alex, having been informed of Josh's death by Lieutenant Nathanson, tracks the gem to the statue which she tracks to Beaumont, who sends Alex to visit Wendy Derleth, a folklore professor. Wendy explains the history of the gem and the nature of the djinn: a djinn grants wishes in exchange for souls, but as djinns are demonic in nature, the wishes will be twisted into curses for the djinn's amusement. Alex learns that the Djinn needs to power the gem with human souls and then grant her (the person who originally released him) three wishes before he can open the gateway to release his fellow djinn on Earth.
Meanwhile, the Djinn takes the form of a dead man and uses the name Nathaniel Demerest. He kills a pharmacist with the wish of a vengeful vagrant and grants sales clerk Ariella's wish for eternal beauty by turning her into a mannequin. Searching for Alex, he goes to Nathanson to gain her information. Nathanson refuses to help him, but the Djinn grants Nathanson's wish to easily prove a criminal's guilt by having the criminal go on a shooting spree inside the police precinct, and in the chaos finds Alex's home address and leaves. The Djinn next visits Nick. Nick agrees to help in exchange for a million dollars, which he receives when his mother takes out a life insurance policy and is killed in a plane explosion.
Alex sees troubling visions every time the Djinn grants wishes. She consults Derleth again but realizes she is actually talking to the Djinn, who has killed Derleth and taken her form. The Djinn confronts Alex and offers her three wishes. In the spirit of fair play, he offers her a "free" wish, to see what will happen. She wishes for him to shoot himself, but he is immortal and the gunshot fails to harm him. Using the first of her three official wishes, Alex wishes to know what he is. The Djinn teleports her to his hellish world within the gem where the souls of his victims are tortured which terrifies her as he boasts of his evil to her. She then wishes to escape back to her apartment, alone.
The Djinn threatens Alex's sister, Shannon, so Alex hurries to a party to which Beaumont had invited Alex and Shannon. The Djinn follows, again disguised as Demerest. Alex tells doorman Johnny Valentine to hold the Djinn, as he is trying to kill her; however, the Djinn manipulates Valentine into making a wish "to escape his routine life," allowing the Djinn to kill Valentine, making his way into the party. The Djinn charms Beaumont, who wishes his party would be unforgettable. The Djinn causes the artwork in his party to come to life and kill Beaumont, the guests, and the security guards called in to help. The Djinn corners the sisters and attempts to scare Alex into making her third wish by trapping Shannon in a burning painting.
Alex wishes that crane operator Mickey Torelli had not been drinking on the job two days ago, which the Djinn is forced to grant. This undoes the events that followed the statue's destruction and traps the Djinn in the fire opal once again, as the now-sober Torelli lowers the crate without problems. Alex visits Josh, who is now alive again, and notices that Alex seems pleased with herself, though she does not explain why. Inside the jewel in the statue of Ahura Mazda, now in Beaumont's private collection, the Djinn sits on a throne, waiting to be released.