Lower Agrabah is one of the provinces of Agrabah, ruled by a Sultan, whose heir is his son Mirza. Unknown to the Sultan, he has an illegitimate son, Jafar, from a past relationship he had with a healer named Ulima. One day, Ulima she is stricken with illness. Believing her time has come, she tells her son about his real father. She gives him a ring and with the last of her strength, Ulima implores Jafar to show it to the Sultan as proof of their blood relation as she believes he won't turn him away. She passes away shortly after, and as her body gives off a magic dust, Jafar weeps over her body.
One day, Jafar purposely steals from a palace guard in order to gain access to the throne room, where the Sultan orders for his thieving hand to be cut off as punishment. The boy holds out his hand to be cut off, but then, the Sultan recognizes a ring that the boy is wearing, which he once gave Ulima. Realizing the boy is his child, the Sultan deducts that Jafar only stole so that he could meet him and reveal his identity. Jafar wishes for his father's recognition, however, the Sultan decides to make him a serving boy in the palace.
Later, in a meeting with officials, the Sultan listens to them complain about a supply blockade with the kingdom's northern neighbors. He refuses to help them, and asks Mirza to explain why they cannot provide aid. Mirza explains that it is against policy, however, when questioned by an official about which policy it is, he is unable to answer. Jafar demonstrates superior knowledge by explaining that the farm policy is the reason why the Sultan cannot help. The Sultan, in an attempt to cover his son's humiliation, quickly fabricates the story that in Agrabah, even servants are educated. He later walks in on Mirza beating Jafar for his prior humiliation and encourages his son to continue, stating that when he is Sultan one day, he must be feared. The Sultan later apologizes to a lonely Jafar in the washing room, stating that his son must be raised properly. As Jafar goes to dry his face, the Sultan drowns him in a water basin, and later has the guards dispose of his body on the outskirts of the city. With the mysterious power of magic, Jafar is revived, with a desire for revenge against the Sultan. ("Bad Blood")
With nowhere else to go, Jafar gains an apprenticeship with a rough and unruly Blacksmith. One day while he is being verbally abused by him, a powerful sorceress, Amara, comes to town. Seeing as everyone fears her tremendously, Jafar goes to her home that night asking to learn dark magic. When she asks why, he states his desire to take revenge on his father, the Sultan, for abandoning him as a child. She accepts his reason and begins teaching him the dark arts in student-mentor relationship. At older age, Jafar graciously thanks a shepherd, Akil, for returning a goat he lost and gifts him a flask of alcohol. Jafar meets up with Amara, who still won't let him learn spells from a particular book. Instead, she deems him ready to learn a masking spell, but Jafar is confused since they need a liver for it to work. She explains they do indeed have a liver since the wine he gave Akil was previously poisoned by her. Horrified, he watches from the window as his friend begins stumbling in pain. When offered an antidote, Amara remarks that he may save a life, but then they won't have a liver for the spell. To prove he is willing to do whatever it takes for magic, Jafar lets Akil die. A pleased Amara congratulates his choice and lures him into a lustful kiss. Later, she asks for his help to find the three genies of the land, and when they do, the two of them can become the most powerful sorcerers and bend the laws of magic to gain whatever they want. ("The Serpent")
Jafar finds the last genie's whereabouts, but out of a desire to not share power with Amara, he poisons her drink, which she sips. Coldly, Jafar confirms he will be finishing the spell on his own with her assistance. He turns her into a snake, and then into a serpent staff to access to her magic at any time. ("The Serpent")
One day, Jafar forces his way into the Sultan's palace and confronts the Sultan in the throne room. Jafar threatens to kill him, and challenges Mirza to a duel. The Sultan watches in shock as Mirza attempts to flee, but is murdered by Jafar's magic. Jafar states that he wants to be acknowledged as his son, but the Sultan refuses to give him what he wants. ("Bad Blood")
In search of the last genie, Jafar arrives at a small scarf shop of a merchant, Farzeen Shahmed, and questions the good fortune of the shop owner; insisting the man's accumulated wealth is magically based. He follows the man into the back room to see the merchant wishing the genie, Cyrus, away to a far off land where no one will find him. Jafar grabs for the lamp, but it disappears into thin air. Furious, he asks the merchant where the lamp was sent. Shakily, the merchant admits he doesn't know, so Jafar suffocates him to death. ("Trust Me")