Ba Sing Se has fallen, and Aang is critically injured. He awakes to find his group on a Fire Nation ship disguised in similar regalia.
Sokka has planned a small-scale invasion of the Fire Nation to simply capture the Fire Lord's palace and defeat Fire Lord Lord Ozai, making use of their previous plan to take advantage of a soon-approaching solar eclipse which will render Firebending impossible for eight minutes. However, instead of the Earth Kingdom army and navy, the invasion will be staged by a ragtag group of benders and warriors who became allies of the Avatar along his journeys in Books 1 and 2. Aang and his group then infiltrate the Fire Nation and travel to the rendezvous point for the invasion force. Also, Aang starts to have nightmares about meeting the firelord.
The invasion proceeds as planned with the group defeating much of the defenses and capturing the area around the palace, but Aang finds that the palace had been evacuated beforehand and the fire nation had foreknowledge of the invasion; the royal family has taken refuge in a nearby bunker under a volcano and prepared an air fleet in a surprise counter-maneuver. Aang never finds Firelord Ozai, but Zuko does, and uses the eclipse as his chance to confront his father and proclaim his decision to join the Avatar. As the group realizes they have failed in their main objective, they abandon the captured Fire Nation capital and make a desperate effort to reach their ships to escape. However, the pursuing air fleet destroys the protagonist party's ships. Now, only Aang's sky bison Appa can provide a means of escape, and Aang retreats with the children and teens aboard Appa while the adults stay behind and are taken captive.
Zuko catches up with Aang at the Western Air Temple and offers to teach Aang firebending, to complete his training as an Avatar and master all four elements. After a brief conflict, he is allowed to join the group. The two travel to unlock the firebending secrets of the original firebenders, the secretive "Sun Warriors". He and Sokka also plan an infiltration of Boiling Rock, a high-security Fire Nation prison surrounded by the boiling water within a volcanic caldera, where high ranking prisoners of war are kept. They find Sokka's father and Suki, the leader of the Kyoshi Warriors and Sokka's former love interest, but Zuko is quickly discovered and Azula comes to question him, accompanied by Mai and Ty Lee. Both girls eventually aid Zuko and Sokka in escaping the prison, betraying Azula in the process. Enraged, Azula demands their imprisonment and begins to slip into paranoia and insanity at the loss of her most trusted confidants and the later misguiding of her own father, the Fire Lord.
After regrouping, Sokka tries to create a new battle plan to defeat the Fire Lord before he can make use of the approaching Sozin's comet to empower himself and his armies (the worst case scenario the avatar had been trying to prevent since Book 1), but peace-loving Aang refuses when they ask him to kill Firelord Ozai. In his confusion, he is drawn to a mysterious island and meditates on other ways to defeat Ozai by calling on the spirits of other past Avatars for advice. Each Avatar advises him to destroy Ozai, and Aang is reluctantly resigned to killing him until he discovers that the island that he and Momo are on is really an ancient, giant, wise "lion-turtle." Aang asks it for advice, and the Lion-Turtle teaches him the ancient art of Spiritbending as a way to avoid killing Ozai.
On the day of Sozin's Comet, Fire Lord Ozai, now the self-proclaimed "Phoenix King" harnesses the comet's power to start a genocidal campaign to finally annihilate the Earth Kingdom. Princess Azula (Ozai's daughter and Zuko's sister) has come up with a plan to use the airship fleet to destroy the hope of the Earth Kingdom, thus ending it. While Aang and Momo are still missing from their own trip to the "mysterious island", Aang's friends set off to face Ozai, Azula (soon to be crowned the new Fire Lord), and the entire Fire Nation army. Zuko and Katara go to face Azula just moments before her coronation, so that he can usurp the throne in her stead; Sokka, Suki and Toph sabotage the air fleet; and the Order of the White Lotus fights to reclaim Ba Sing Se from the Fire Nation. Aang returns just in time to take on Phoenix King Ozai. Finally reclaiming his ability to enter the Avatar State, Aang almost kills Ozai before restraining himself and instead calls upon the lost art of Spiritbending to remove Ozai's bending abilities altogether. The war is over, Zuko is crowned Fire Lord, and alongside Aang, he ends the war and promises to bring harmony to the entire world. As Fire Lord Zuko visits his father in prison and demands to know the location of his mother right before the whole group is together for tea in Iroh's teashop in Ba Sing Se. While Sokka is painting a picture of everyone, Aang goes out, Katara follows him, and the series ends with them kissing.