The liberation of Ba Sing Se was one of the final battles of the Hundred Year War. The secretive Order of the White Lotus, led by Grand Lotus Iroh, penetrated Ba Sing Se and fought against occupying Fire Nation forces in order to free the city in the name of the Earth Kingdom.
The large Fire Nation garrison outnumbered the small Order, and the arrival of Sozin's Comet increased their power. However, the Order consisted of the most powerful benders and fighters in the world, including some firebenders of their own. This meant that the Order had a considerable tactical advantage, ultimately leading to their victory.
The city of Ba Sing Se was the last Earth Kingdom stronghold after the fortress city of Omashu fell to the enemy several months prior. Throughout the entire course of the Hundred Year War, Ba Sing Se was the country's major source of soldiers, food, equipment, etc. Ba Sing Se was once considered unconquerable due to the Fire Nation's failure to penetrate its walls.
However, roughly three months prior to the arrival of Sozin's Comet, the Earth Kingdom suffered a heavy defeat when Princess Azula and her two allies, Mai and Ty Lee, infiltrated the city disguised as Kyoshi Warriors. Through her expert manipulation, Azula was able to secure control over the Dai Li, the power-hungry cultural enforcers of Ba Sing Se. She was also able to enlist the help of her exiled brother Prince Zuko, who was desperate to return to the Fire Nation. Together, they overthrew Earth King Kuei and defeated Avatar Aang in a coup d'état that left Azula in total control of the city, denying the country the resources necessary to win the War. Within days, the Dai Li demolished the city walls and the Fire Nation Army conquered the city, securing almost total victory over the Earth Kingdom.
The people of the world realized that if balance was to be restored to the world, Ba Sing Se had to be restored to the Earth King's rule. Earthbenders organized underground rebellions to resist the occupation, which denied the Fire Nation full control of the city. However, their efforts would not be enough to drive out the invaders before the comet arrived and the city became threatened by Ozai's airship armada.
In an effort to save the city from destruction, the Order of the White Lotus, a secret organization transcending world boundaries, initiated a mission to liberate the city on the day of the comet's arrival. With its power, the Order's firebenders would give the society's small army a significant advantage over the Fire Nation Army.
Prior to the arrival of Sozin's Comet, ex-General Iroh, a Grand Lotus of the Order, sent out a signal to other members of the society advising them to gather at Ba Sing Se. The day before the scheduled operation, the Order encountered Prince Zuko and his allies. Iroh and Zuko were reunited and it became clear that if the Hundred Year War was to end, the Fire Nation would need to be decisively defeated at Ba Sing Se.
Upon the comet's arrival, the Order laid siege to the city. With a single powerful blast, Iroh breached the Inner Wall. The Order promptly advanced toward the wall to enter the city. Dozens of firebenders from atop the walls rained fire down at the invading army with no effect, and the Order broke into Ba Sing Se. Heavy fighting took place at the main plaza of the Lower Ring and the streets became littered with broken down shells of the occupiers' tundra tanks. The Order advanced to the center of Ba Sing Se as the retreating army was encircled in hundreds of pockets throughout the city.
Hours of intense combat passed, lasting throughout the night, but the outcome became clear. Iroh burned the Fire Nation flag that hung over the Earth Kingdom Royal Palace, symbolizing that the Earth Kingdom was free once again with the Fire Nation's defeat, and by morning, Ba Sing Se had been fully liberated.
Though much of Ba Sing Se was damaged in the battle and the walls needed extensive repairs, the city was freed from the Fire Nation's rule. With the appointment of Zuko as Fire Lord, the Fire Nation undertook efforts to rebuild its relationship with the Earth Kingdom.