Nearly vanquished by Koto's troops, Julien rallies his loyal friends for one last attempt to regain his throne.
The sword continues heading for King Julien. Clover, Maurice and Mort all try to stop the sword but all of their attempts fail. However, the sword pierces Benson's butt cheek. Clover arrives to try to convince Julien to escape the battle alive before they start celebrating. Julien refuses to leave, stating that they "obviously have the upper hand".
However, Pineapple reveals that as it turns out, they do not have the upper hand, and that the worst is yet to begin. On the morning of the Battle of Booty Ridge, the kingdom, along with assistance from the foosa, snails, Mort Horde, Butterfly Kingdom, Aye-Aye Kingdom and the Rat Kingdom launches a major attack on the mountain lemurs, but most of the kingdom runs away after remembering that the mountain lemurs are big, strong, and heavily armed.
The combined forces retreat. King Julien thinks that there is no hope, but Maurice realizes that there is a way that they can win. The mountain lemurs attack as one unit and rely on their actual physical strength. They have multiple kingdoms with multiple talents and strengths. Clover states that she would give her life to save the kingdom, and the rest of the army, including the foosa, Mort Horde, Karl, and Chauncey, pledge allegiance.
The following morning, Julien offers Koto a chance to surrender to him. Koto refuses, resulting in an all-out war where the different kingdoms, including Tentacle and his father who arrive a while later, combine their forces to defeat the Mountain Lemur Kingdom. Eventually, the mountain lemurs retreat.
King Julien announces a big victory party, but Koto attacks him and prepares to kill him before he can even finish his speech. Sage flies up with his hawk to help, and gets Koto to release Julien, who is saved by Clover. The two brothers fight (while Pancho and Mort comment), and Sage manages to steal his replacement tooth back.
The two brothers land at the foot of Koto's statue. Sage prepares to kill him, but Clover stops him, finally understanding the purpose of their quest. She tells him Koto deserves punishment for what he did, and killing him would be too easy. She tells him she realized there are other solutions than violence, and that with his nonviolent ways, he is perfect to her. They hug. Julien also agrees to let Koto stay alive so that he can "stew in all of his life's mistakes in exile, or some sort of jail situation, or just like a really aggressive time-out". Sage agrees to this and spares his brother's life. However, King Julien accidentally murders Koto by crushing him to death by leaning on the statue.
The big victory party starts, and lasts for three weeks, somehow causing more damage and larger casualties than the war itself. In the end, the kingdoms all go their separate ways. King Julien finds out that there is something wrong with the throne: Koto has already made a weird and slightly wet butt groove, so he calls for Maurice to fix it.