The film begins in an ancient location where a man is cornered by a sorcerer after a knife-throwing accident. The sorcerer transforms the man into a genie and traps him in a lamp as punishment.
Two thousand years later, Bernard Bottle, an art dealer for a prestigious firm in London, scores a huge sale and earns his company fifty million pounds. His boss, Charles Pinkworth, congratulates him on the sale, but when Bernard reveals that he gave half of the money back to the original owners of the paintings, Pinkworth fires him. Bernard returns dejectedly to his flat and seeks comfort, but discovers that his girlfriend has been sleeping with his best friend. She then clears Bernard's flat of nearly everything, leaving behind only a small amount of furniture and an ornate antique lamp. He attempts to clean the lamp, causing an explosion that sends him to the hospital.
When Bernard returns to his flat, he encounters a man who tries to kill him. During the fight, Bernard wishes that the man could speak English, at which point he does. When the man states "Your wish is my command", Bernard wishes for the fight to stop, which it does. Bernard learns that the man, named Josephus, is a genie who had been trapped inside the lamp for two thousand years, and that he can grant almost any wish. The two forge a friendship in which Bernard introduces Josephus to modern food, music and entertainment, as well as using wishes to furnish his flat with expensive furniture and even the authentic Mona Lisa, which is subsequently reported missing from the Louvre.
After a night on the town, Bernard returns to his flat without Josephus (who is watching movies at a theater) to find someone inside. He picks up a sword and attacks the person around the corner, inadvertently killing a police officer. A detective in the flat then reveals Pinkworth, who accuses him of grand theft, pointing to the Mona Lisa. Bernard finds himself unable to wish the painting away and is arrested for grand theft and murder. At the station, Bernard tries multiple times to call Josephus at his flat, but at first Josephus doesn't hear the telephone ringing, then fails to understand how the device works. He starts hanging up the phone each time it rings, which the police interpret as a form of coded communication. Bernard is put in jail, and Josephus eventually joins him in the cell. Bernard then wishes he could go back and do things differently, which suddenly causes time to rewind back to when Bernard was about to enter his flat.
Bernard then enters his flat with confidence (and with Josephus by his side), where his boss again accuses him of grand theft. However, this time, a different and much less notable painting is on the wall, and the detective learns the Mona Lisa has been returned to the Louvre. The police apologize for the intrusion and leave.
Bernard and Josephus discuss the meaning of Christmas and how the holiday has become commercialized over time, then they set out to grant wishes for children at a local mall. They also cause Bernard's elevator operator to win the lottery (which he claims to have won twice before), get Bernard's former girlfriend and best mate arrested on drug charges, and bring about a rare snow to London. Finally, they cause Pinkworth's entire fortune to be donated to a charity organization which, in a televised news event, gathers at Pinkworth's house to express their gratitude, to his great dismay.
Josephus expresses a desire to return to his own time, and after an emotional conversation, Bernard absentmindedly says he wishes Josephus would go, causing the genie to disappear. Bernard is left with a ticket to the shopping mall where he and Josephus had granted wishes earlier. He hands the ticket to the woman at the entrance to see Santa Claus, and she asks him what he would like for Christmas. A moment later, Bernard is outside and waves to the woman through the window, who blows him a kiss in return. He cheers and heads home.
The opening scene of the film is repeated, where Josephus is cornered by the sorcerer again. However, this time Josephus bargains with the man, revealing a thick-slice toaster that piques the man's interest.
A DVD was released for Region 1, albeit unauthorized, on 4 September 2007.