"The Last Battle" is the sixth episode of the animated television series Star Wars Rebels third season. It is the forty-third episode of the series overall. It aired on October 22, 2016 on Disney XD.
In the search for arms and artillery, Captain Rex brings the rebels to an old abandoned base from the Clone Wars. They quickly find that they're not alone, however, and must once again face enemies from the past.
The episode opens with the rebel freighter Ghost descending into the atmosphere of the planet Agamar. The Ghost lands near the wreck of a former Separatist supply ship. The Spectres and Captain Rex disembark from the ship. When Hera Syndulla asks if anything will go wrong, Kanan Jarrus jokes that everything will go horribly wrong. Ezra Bridger reassures her that they will be fine since they have Rex with them. The Ghost then departs into space with Hera and Sabine Wren aboard.
Rex the explains to Kanan, Ezra, and Garazeb Orrelios that there was a battle on Agamar during the Clone Wars and adds that the wrecked Separatist transport is ideal to find ammunition including proton bombs. When Ezra asks if they were fighting battle droids, Rex tells him that the transport ship used to be crawling with "clankers." Zeb asks Rex how many battle droids he blasted. Rex estimates he destroyed thousands if not tens of thousands but that he did not keep count unlike some of the other Clone troopers.
Ezra picks up a B1-series battle droid's head and opines that the droid doesn't look dangerous. Rex then responds that these "clankers" killed many Republic soldiers during the Clone Wars including several of his friends. Kanan adds that battles leave scars including some that cannot be seen. The rebels then walk among the transport's munitions depots. Rex discovered that they are fully loaded with proton bombs. Meanwhile, Chopper detects several operational B1 battle droids which utter "Roger Roger."
Later, Rex and his team find themselves trapped inside a ray shield, a technology that the Separatists used to protect their battle droids. Ezra then notices that they are being surrounded by scores of battle droids. One battle droid commander B1-268 tells them that they have been captured by the Separatist Alliance and orders his comrades to blast the Republic "invaders." However, B1-268 then receives new orders to stun and capture the intruders. Ezra then asks what the call sign "Roger Roger" means. B1-268 orders his men to take the prisoners to the command center. Unknown to the droids, Chopper is spying on them with his camera. B1-268 then remarks they have never captured anyone before. The rebels are knocked out by a stun ray.
Later, Rex wakes up at the Separatist command center in the bridge of the wrecked transport. He finds himself the prisoner of a super tactical droid named Kalani, who thanks B1-268 for his services. Rex has flashbacks of the Clone Wars and calls out the name of his former comrade Cody. However, Kanan brings him back into reality and tells Rex that their captor is a super tactical droid. When Ezra asks if this is bad, Rex confirms this is so because the super tactical droid is intelligent.
Kalani then speaks to the rebel prisoners and observes that the Separatist Droid Army outnumbered the Grand Army of the Republic to the extent that he calculated that their chance of defeat was 23.8%. When Rex asks Kalani why he is still operating despite Order 66, the super tactical droid explains that he overrode the command signal on Agamar because he believed that it was a Republic trick. Rex is adamant that the Clone Wars are over regardless of what Kalani thinks and demands that the droid release him.
Kalani rejects his demand and responds that this is the perfect opportunity to end the war as a victory for the Separatist Alliance. Kalani wants his prisoners to fight in order to prove his theory that the Separatists had a higher chance of victory than the Republic and Jedi. When Zeb protests that he will have no part in Kalani's war game, the tactical droid agrees with the Lasat on the grounds that his species was not involved in the Clone Wars. Instead, he designates Zeb as the hostage that the other rebels must rescue in a rescue simulation base on 132 Clone Wars battles. Kanan and Rex refuse to fight but Ezra insists that they should take up this challenge as a game. Kanan and Rex then change their minds. Ezra also demands that Kalani release Zeb and give them all of the proton bombs if they win the exercise. Kalani accepts Ezra's deal.
At Kalani's command, B1-268 announces that the commander has initiated Battle Plan Zeta and orders the other B1 battle droids to assume their positions. Chopper spies on the battle droids and enters a Neimoidian escort shuttle which he begins to restart. Meanwhile in space, Hera and Sabine are flying the Ghost, which is being pursued by three TIE fighters. Sabine thinks that Kanan and Ezra are expecting them back on Agamar soon. Both haven't heard from their rebel comrades but think they will contact them if they need help.
Elsewhere, aboard an Imperial Star Destroyer, Agent Kallus congratulates Governor Arihnda Pryce on her plan to trap the rebels at a fuel depot. Pryce replies that their plan is only successful if they can catch them. Admiral Kassius Konstantine then reports that they have received an encrypted distress signal from Agamar. Pryce thinks it strange for the rebels to fall into trouble but issues orders for the nearest Imperial outpost to send troops to Agamar immediately.
Back on Agamar, Kalani outlines the rules of engagement: the rebels must fight their way back to the command center in order to free Zeb. Rex agrees to lead the charge due to his Clone Wars experiences and proposes striking at the unguarded hangar. He hopes to surprise the droids. The battle commences at Kalani's orders and a column of B1 battle droids attacks the three rebels. Kanan tells Ezra to follow the Sword and Shield maneuver which involves deflecting blaster bolts and hurling grenades at the advancing droid columns. Putting their plan into action, the rebels advance forward after shattering the first assault wave. Rex tells Ezra to stay together as they advance into the hangar.
Ezra sees the hangar is clear and suggests entering. However, Rex cautions against it because the battle droids' strategy is to keep advancing forwards and calls the rebels to wait. Kanan responds that the tactical droid has had a long time to think. Rex understands how much it means to Kalani's programming as well as his own. Rex explains to his Jedi comrades that Clone troopers were bred for combat. Together, Rex and the Jedi advance into the hangar. Meanwhile, Zeb tries to talk Kalani into surrendering but the super tactical droid retorts that he was not programmed to understand his sense of humor. Kalani then reveals that the rebels have taken his "bait" and sends several droidekas to intercept them.
Unable to break the droideka's deflector shields, Rex and the Jedi are forced to retreat. Ezra comes up with an idea to collapse the catwalk on to the droidekas. Kanan and Rex agree to provide covering fire while Ezra heads towards the catwalk. Meanwhile, Kalani notes that the Jedi have split up as they do 76% of the time and sends more battle droids to pursue Kanan and Rex. Meanwhile, Ezra encounters Chopper; who tells him he has sent a distress signal. Chopper tries to drag Ezra away into the Neimoidian shuttle but Ezra insists that he is not leaving without Rex, Zeb, and Kanan. Ezra tells Chopper to get the shuttle ready while he fetches the others.
Ezra's delay annoys Kanan and Rex, who are under fire. Rex attempts to move but is shot by a battle droid. Meanwhile, Ezra uses the Force to collapse the catwalk over the droidekas. Kanan checks that Rex is alright due to his Clone trooper armor and they continue towards the command bridge. On the way they encounter Ezra. When Ezra remarks that he would make a good soldier, Rex points out that their plan was dependent on good timing and chides Ezra for his tardiness. When Ezra tries to explain that Chopper wanted to show him something, Rex warns Ezra that this is not a game and that his every move affects everyone. He tells Ezra that they need discipline and strategy. Kanan tells Ezra not to take Rex's words personally because Rex is determined to finished the battle.
On the way, the rebels soon run into another droideka which Rex knocks out with his helmet following a brief struggle. Rex then notes that the droideka is as old as him. Kanan checks on Ezra who says that he will be fine. Rex and the rebels breach the command center and declare victory. However, Kalani disagrees and prepares to execute Zeb at gunpoint. However, Ezra intercedes and points out that the droid army is so old that they could never have won. While Kalani listens, Ezra ponders on the reasons why the Clone Wars ended so rapidly.
While Kalani struggles to answer, Zeb explains that the Galactic Empire is the reason why the Clone Wars ended. Zeb then points out that the Empire has arrived in the form of landing craft. The droids and rebels then stand down while Ezra asks Kalani how the droid army will fare against the Empire. Kalani admits that his droid army is depleted but emphasizes that they are not at war with the Empire. Kalani then orders B1-268 to analyze the approaching Imperial forces. Two Imperial landing craft land near the transport ship and deploy several stormtroopers. B1-268 and his force tries to greet the Imperials but are attacked. B1-268 himself is crushed by an AT-AT walker, that is deployed by a landing barge.
In light of the recent events, Ezra argues that the rebels and droids face a common enemy. Rex is about to interject but Kanan tells him to let the boy continue. Ezra then tells Kalani that the fighting between the droids and clones allowed the Empire to take over. When he asks Kalani what the Separatist were fighting for, the super tactical droid replies that they were fighting for freedom against the Republic's tyranny. Ezra points out that he and his fellow rebels have always been fighting against tyranny. Based on Ezra's words, Kalani deduces that the Empire is the successor to the Republic and accepts the logic that this makes the rebels allies.
However, Kalani admits that his forces are depleted and that they have a low chance of success since they are fighting against insurmountable odds. Kanan says that he can help Kalani and the battle droids. Ezra then contacts Chopper via comlink, who informs him that the Empire is here. Ezra asks Chopper about the progress with the Neimoidian shuttles. Kalani is worried that the Empire will shoot down their shuttles. When Kanan asks about the proton torpedoes, Kalani says he did not deploy them because his forces lacked laser cannons to fire them.
Rex then comes up with a plan to roll the proton torpedoes onto the feet of the advancing AT-ATs and AT-DP walkers. Since the battle droids are poor shots, Kalani comes up with the idea of having the battle droids fire at Ezra and Kanan. The two Jedi will then use their lightsabers to redirect the blasts at the proton torpedoes. Then the battle droids will attack. Kanan tells the battle droids to get the munitions ready to roll.
Meanwhile, the Imperial walkers advance towards the hangar. Before preparing for battle, Rex remarks that this is the last glorious day in the Grand Army of the Republic as he observes the Imperial walkers. Ezra tells Chopper to get the shuttles ready. He also orders D Squad to get ready for their attack. Kalani admits never attempting such a desperate strategy; prompting Rex to state "that's why we [the Clone troopers] always won." Kalani then replies "not always." Ezra then tells the battle droids to evacuate on their shuttles once the shells have exploded.
Zeb throws a grenade that knocks out an advancing AT-DP walker. Zeb joins battle droids and droidekas in the attack while other droids roll the proton torpedoes. Putting their plan into action, Kalani orders his droids to fire at Ezra and Kanan, who then deflect the blasts at the proton torpedoes. The torpedoes explode and destroy the frontal legs of one of the AT-AT walkers; causing it to topple. The battle droids then flee aboard two Neimoidian escort shuttles with the rebels following suit. One of the battle droids is accidentally knocked off the ramp of a shuttle. Rex tries to warn the first of the droid's shuttles to bank to the right. However, the shuttle is shot down by a second AT-AT walker. The remaining droids' shuttle and the rebels' shuttle managed to escape stormtrooper fire.
Having escaped into space, the rebels contact Kalani by hologram. When Ezra says that their escape was a victory, Kalani responds that it was a successful strategy but not a victory. Rex supports Ezra and thanks the boy for ending the Clone Wars; something which eluded an entire "galaxy of senators." Rex also commends Ezra for finding a middle path that entire armies of Clone troopers and battle droids failed to find. Ezra responds that all he did was point out that none of them could win the Clone Wars. Rex and Kalani accept Ezra's explanation and make peace.
Based on this battle, Kalani calculates that the rebellion had a 1% chance of success against the Empire and says that this is where they must part company. Ezra says affirmative and salutes him. Rex promises to tell Ezra about the Battle of Geonosis while the two ships part company. At that point, they are contacted by Hera who asks them over the intercom how their mission is going. Rex tells Hera that they did not manage to obtain the proton bombs but that they instead found the Ghost a new transport.
For this episode, the series logo was redesigned in the style of The Clone Wars TV series and the Clone Wars theme was played in the ending scene.