Jafar forces Iago to help him in his schemes to imprison Jasmine, the Sultan, Abu, Carpet & Genie and frame Aladdin for murdering the Sultan and get him executed, but the moment Jafar leaves to see Aladdin’s execution, Iago frees the Genie, and he saves Aladdin from certain death and frees the others. Iago is forgiven for what he’s done, but he refuses to help them get Jafar’s lamp so they can destroy it, and him with it, fearing Jafar’s wrath for betraying him. He leaves the palace while they go after Jafar.
The group tries to take the lamp covertly while Jafar and his “master” Abis Mal are in the midst of an argument, but Jafar discovers them and attacks them. Both sides struggle for possession of the lamp until, eventually, Jafar creates a pit of lava, with the lamp on a rock pedestal and Aladdin on a nearby rock that Jafar slowly submerges. Then, Iago reappears to help, but after he snags the lamp, Jafar blasts him out of the air, badly hurting him and making him and the lamp land on a ledge near the lava. As Jafar gloats to Aladdin about Iago’s failure, Iago uses whatever strength he has left to kick the lamp into the lava, destroying Jafar. Aladdin collects Iago and they get out of the pit just as the last of Jafar’s magic comes undone, and Iago is truly seen as a real friend by all.
The Sultan offers Aladdin the position of royal vizier, but he turns it down, wanting to see the world. He and Jasmine immediately make plans to do so.
*After the credits roll, Abis Mal caught in a tree from Jafar’s onslaught asks “Does this mean I don’t get my third wish?”
Thanks Tornado Dragon!