William Kennijahn is sentenced to be hung for murdering his business partner, who was about to make known Kennijahn's crooked stock dealings. Sitting in his cell, filled with hate and vengeance, he unknowingly and accidentally summons up a creature called Drdr who is obligated to fulfill six wishes for Kennijahn before he can return to his native realm. The creature informs him of a rule limiting wishes, that no man can escape his ultimate fate; in Kennijahn's case, his fate is to be hung. He doesn't believe the creature, and believes there is some way for him to escape ultimately being hung.
His first wish is to be in Buenos Aires, as a prosperous American businessman. He runs into immediate trouble with the authorities — he doesn't have his travel papers with him. He returns to his hotel under the pretext of retrieving his papers. While there, however, he contacts Nina, his mistress (still in America), and requests for her to come down with his travel papers. Before she arrives, the local police come and arrest him; it seems he is wanted by the American police for murder and had intercepted his message to Nina.
While on the plane back to America, guarded by the police, Kennijhan summons Drdr to make his second wish. But before he does, he requests information from Drdr on the limitations on wishes. There are monetary limitations, the fate limitation, and countless others. Deciding that making a new start would be a waste, since he could be caught anywhere, he wishes to be in the past before he murdered his partner. The creature warns him that if he does go back, he will not be able to contact Drdr until the time comes around when he originally summoned him. His wish is answered, and he finds himself back in the prison cell where he started, sentenced to hang for murdering his partner.
Furious, he summons Drdr. The creature explains that Kennijahn did not wish to retain the memories of all the events that happened after first contacting him. So Kennijahn had gone back six months, and done again all the things he had done the first time around. It is also revealed that Drdr is intentionally letting Kennijahn waste his wishes, and taking advantage of loopholes in his wording, to hasten his return to his native realm. Kennijahn asks if he can be put back six months, with memory and a changed character to be more honest. Drdr says changing character is another limitation and cannot be done; so Kennijahn's third wish is to be put back six months with memory of all his dealings with Drdr, and the creature again reminds him that his help cannot be sought until the date when Kennijahn was to be hung.
He arrives in his office, and establishes that it is indeed six months in the past. He calls up Nina and proposes. He then goes to see his partner, Andrew Harmsworth and makes known that he intends to pull out of the stock dealings and retire. Harmsworth, furious at Kennijahn for pulling out, draws a gun and tries to coerce him to stay in. During the resulting struggle with the gun, Harmsworth is accidentally fatally wounded. No-one believes his story that Harmsworth was threatening him, a man much larger than Harmsworth. And the gun legally belongs to Kennijahn, except that he had given it to his partner a year ago. He is sentenced to death far sooner than the first time around, and it takes quite a lot of bribery and dirty dealings to get even a month-and-a-half delay, just long enough for him to contact Drdr again.
His fourth wish is to be transferred into the body of Henry Pearsall, a multimillionaire, reasoning that since he, Kennijahn, is destined to be hanged, that if he can escape from his own body he can escape his fate. So Drdr moves the mind and soul of Henry Pearsall into Kennijahn and vice versa.
Mere hours after the transfer, Kennijahn settles down to read the evening paper in Pearsall's body. He reads of Kennijahn's escape from jail, and moments alter Pearsall in Kennijahn's body breaks into the house and confronts Kennijahn in Pearsall's body. Pearsall in the other man's stronger frame overpowers Pearsall's weaker form, and sets up a noose to hang Kennijahn.
Drdr rescues him at the last moment; for if Kennijahn does not get all six wishes, he cannot return to his realm. Resigned, he wishes to be exchanged with a rich person who is also destined to be hung. The creature answers the wish, but places Kennijahn in the other man's body at the moment the man was committing suicide by hanging himself. He struggles and gets enough air to gasp out Drdr's name to summon him and make his sixth wish to escape. However, Drdr reveals that he answered Kennijahn's unspoken wish to escape during his fight with Pearsall. There are no wishes left for him to make. Kennijahn meets his fate, and Drdr is finally free.