"Twilight of the Apprentice" concludes the second season of the Star Wars Rebels animated television program. This special, hour-long presentation, which premiered on Disney XD on March 30, 2016, encompassed the season's twenty-first and twenty-second installments. In the overall series, it represented episodes thirty-six and thirty-seven.

The episode starts with CT-7567, known as "Rex," communicating with Ahsoka Tano while aboard the Phantom. Rex suggests joining her on her mission, but Tano turns down his offer. He comments that experience is always more important than anything else (referencing their initial conversation), and Tano responds by saying that if that's the case, she definitely outranks him now. Their conversation ends with Rex wishing Ahsoka well. After finishing their communication, Ahsoka heads back to the ship's hangar to rejoin Kanan Jarrus and Ezra Bridger. When Ezra questions Kanan about Rex's worry, Kanan clarifies that the Jedi considered the planet Malachor forbidden territory in the past. Tano then notes that "legends always hold some truth." Subsequently, Ezra asks why Master Yoda would send them to Malachor if it was restricted.
Soon after, the Phantom comes out of hyperspace near Malachor. Kanan believes that Malachor holds something that could aid them in stopping the Inquisitors. Tano then adds that they are in search of knowledge that can help them defeat the Sith. As the Phantom descends into Malachor's atmosphere, C1-10P, the astromech droid known as "Chopper," detects another vessel. The Jedi and Tano then realize they are not the only ones interested in Malachor's secrets. Kanan instructs Chopper to track the other ship. After navigating through several clouds, Ezra notices a large collection of towering monoliths.
As the Phantom gets closer to the structures, Kanan tells Chopper to pinpoint the location of the second ship while the Jedi and Tano examine the site. Ahsoka discovers that the monoliths are inscribed with writings in an ancient tongue that she can understand. Despite Tano's instructions, an intrigued Ezra touches one of the monoliths, causing all three of them to fall into a cavern. While Ahsoka uses the Force to ensure a safe landing, Kanan and Ezra are disoriented by the fall. Underground, the group encounters a massive structure, which Ahsoka identifies as an ancient Sith temple. When Chopper warns Ezra that they might fall through the surface, Ezra responds sarcastically, thanking the droid for the warning. Chopper also informs Kanan that he has located the other ship.
As the Jedi approach the Sith temple, Ahsoka explains that they are seeking forbidden knowledge that will enable them to overcome their adversaries. Along their path, the Jedi and Tano come across an old battlefield filled with fallen lightsabers and the petrified remains of long-dead warriors. Ahsoka recalls that a battle took place on Malachor thousands of years ago, during which the Jedi attacked the Sith temple. When Ezra asks about the battle's outcome, Tano deduces from the ruins that no one emerged victorious. Kanan interrupts them, urging them to continue moving.
Ezra then declares that their quest is like a riddle and starts arguing with his master, when they suddenly see one of the "statues" moving. The figure rushes towards them, and Ezra activates his lightsaber for self-defense. The armored figure then ignites his own red double-bladed lightsaber, revealing himself as an Inquisitor known as the Eighth Brother. The Inquisitor is surprised to find them and throws several explosives at them, causing the ground beneath Ezra to collapse, separating him from his companions as he falls into an underground tunnel. Stating that he will be fine, Ahsoka and Kanan pursue the lone Inquisitor.

While trapped underground, Ezra hears a voice calling out to him from the darkness. Ezra activates his lightsaber in self-defense, prompting the stranger to assure the boy that he means no harm. The stranger then tells Ezra that he has been stranded on Malachor after his starship crashed. When questioned, Ezra reluctantly tells the stranger that he and his friends are on a mission. The stranger responds that he is also seeking knowledge about the Sith and suggests they collaborate. The stranger offers to guide him to the Sith temple but mentions that he is too old to enter the temple alone. Feeling lost and alone, Ezra reluctantly agrees to accompany the stranger into the Sith temple. The stranger introduces himself as "Old Master," and Ezra sarcastically replies that his name is Jabba.
Back on the surface, Ahsoka and Kanan chase the Eighth Brother across Malachor's desolate and scorched landscape. During the chase, Chopper contacts Kanan to inform him that he has located the Inquisitor's ship, which turns out to be a TIE Advanced v1 starfighter. Kanan instructs the droid not to let the Inquisitor escape and warns Chopper that disobeying him will have consequences. Meanwhile, Ezra and the Old Master continue their journey to the Sith temple. Ezra tells him that he needs to return to his friends. The Old Master understands his situation, considering the Inquisitors to be formidable opponents. He then assures Ezra that the Inquisitors and their Sith masters are his enemies.
When Ezra asks the Old Master if he was a Jedi, the man replies that he was a Force-wielder long ago. After Ezra asks if he was a Sith, the Old Master replies that the Sith were the enemies who had torn him from his mother's arms, murdered his brother, used him as a weapon, and then ultimately abandoned him. The Old Master also condemns the Sith for robbing him of his former status. Ezra empathizes with the Old Master's situation since the Empire had taken away his home and his parents. When the Old Master asks Ezra if he seeks revenge, the young apprentice replies that he desires justice. The Old Master then claims that the Sith temple holds the knowledge needed to destroy the Sith.
Back on Malachor's surface, Chopper flies into the Eighth Brother's TIE fighter, encountering the Inquisitor's red blades. Despite the Inquisitor's resistance, he manages to force his way into the cockpit. Shortly after, Kanan and Ahsoka catch up with the Eighth Brother, and Chopper uses the fighter's laser cannons to knock the Inquisitor to the ground. Kanan and Tano then disarm the Brother and take him as a prisoner. Kanan then commends the astromech droid for his successful actions.
Meanwhile, Ezra and the Old Master approach the temple, which the Old Master describes as both a place of worship for some and a tool of destruction for others. When Ezra asks how they will enter, the Old Master explains that two individuals must lift the stones guarding the temple, as that is the way of the Sith. When Ezra questions his extensive knowledge of the Sith, the Old Master tells him that to defeat an enemy, one must understand them, a sentiment Ahsoka had previously shared with Ezra. When Ezra points out that his master disagrees with the Old Master's philosophy that one must practice their beliefs, the stranger responds that he would then be destined to fail.
As Ezra struggles to open the stone door, the Old Master urges him to embrace his anger and passion, something forbidden by the Jedi. Using their anger, Ezra and the Old Master manage to open the temple's first door. However, they discover that the temple has a series of stone doors. This process drains a lot of Ezra's energy, and he asks how many more doors they have to open. The Old Master then encourages Ezra to give in to his rage and anger to succeed. Having gained each other's trust, Ezra reveals his real name to the stranger. In response, the stranger tells him that he is now called "Maul."

Back on the surface, Kanan and Ahsoka interrogate the captured Eighth Brother while Chopper keeps watch. This being the fourth Inquisitor that Kanan and his companions have encountered, Kanan asks if there are more like him. The Eighth Brother replies that there are more than enough to handle him, Ezra, and Ahsoka. The Inquisitor tells Kanan and Ahsoka that he is hunting a "shadow" on Malachor, who turns out to be the former Sith apprentice Darth Maul.
Meanwhile, Maul guides Ezra to the temple's center, where they find a Sith holocron resting on an altar. Maul tells Ezra that only someone willing to risk everything is worthy of the holocron's power. Since the altar is separated by a deep chasm, Ezra tells Maul to throw him to the altar, emphasizing that his master taught him this. Following Ezra's suggestion, Maul throws Ezra towards the altar. Ezra reaches the Sith holocron, but the ground starts to shake as the temple begins to open.
Back on the surface, Kanan and Tano approach the temple with the captive Eighth Brother and witness it opening. While they are distracted, the Inquisitor seizes the opportunity to use his wrist communicator to contact the other Inquisitors. Kanan then sends Chopper to prepare the Phantom for departure. At the Sith temple, the altar starts to rise, and Maul tells Ezra to jump. As Kanan and Ahsoka enter the temple, Kanan suspects Ezra is involved in the recent events. Back at the altar, Maul uses the Force to levitate Ezra to safety and takes the Sith holocron.
Meanwhile, Kanan and Tano receive a warning from Chopper that they have company. Soon after, the Fifth Brother and the Seventh Sister arrive with their red-bladed spinning lightsabers and free the Eighth Brother. Together, the three Inquisitors attack Kanan and Ahsoka. Not long after, Maul and Ezra arrive to find Kanan and Tano fighting the Inquisitors. Ahsoka quickly identifies Maul, as do the Inquisitors. Maul chuckles in amusement and remarks, "What fun!" at the sight of the dark siders. Composing herself, the Seventh Sister notes that the rumors of Darth Maul's survival are true, but Maul clarifies that he is formerly Darth, stressing that he is now called Maul. Kanan warns Ezra to stay away from Maul, but Ezra tells Kanan that Maul is on their side.
Maul then activates his lightsaber and engages the Seventh Sister. As he begins to struggle, Kanan and Tano jump in to help. Overwhelmed, the Seventh Sister calls for a retreat, and they flee. When Ahsoka questions Maul's motives, he claims that he is seeking the same knowledge as them. Maul also warns the Jedi and Ahsoka that Darth Vader himself will arrive soon.

Maul informs the Jedi and Tano that they must take the Sith holocron to the Sith temple's summit to gain the knowledge needed to defeat the Sith. When Kanan and Tano express their distrust of Maul, the former Sith offers to help them defeat Vader. Ultimately, Kanan and Tano agree to Maul's request. Kanan then contacts Chopper to tell him that they will stay behind a little longer. The astromech droid expresses concern but follows Kanan's instructions to keep the Phantom hidden. After Maul reassures them that they are on the same side, the four travelers head towards the Sith temple's summit. When Maul attempts to take Ezra to the top, Kanan disapproves and pushes him aside, leaving Ahsoka with Maul.
Unbeknownst to the four travelers, they are being tracked by one of the Seventh Sister's ID9 seeker droids, which relays their conversation back to the Inquisitors. The Seventh Sister realizes that Ezra has the Sith holocron, while the Fifth Brother states that they cannot allow him to use it. The Eighth Brother vows to reclaim the holocron and departs on his spinning lightsaber to the temple. Before the Fifth Brother can follow, the Seventh Sister advises him to let the Eighth Brother weaken them so they can retrieve Lord Vader's prize.
Inside the Sith temple, Ezra and Kanan argue. When Kanan warns Ezra that Maul cannot be trusted, the younger Jedi accuses his master of holding him back in his Jedi training. Ezra defends Maul, arguing that Maul sees his full potential. Shortly after, the Eighth Brother catches up with them and tries to take the holocron from Ezra. However, Maul and Ahsoka manage to drive him away. When Kanan tells Maul that the Inquisitors know their plans, Maul advises them to split up to better handle the Inquisitors. Maul again offers to take Ezra with him, and despite Kanan's objections, Ezra decides to follow Maul this time. After they leave, Ahsoka assures Kanan that Ezra will be fine because Kanan has taught him well.
As Maul and Ezra make their way to the Sith temple's summit, Maul begins to sow discord between Ezra and his master. He encourages Ezra to use his powers to their full potential. Along the way, they are ambushed by the Seventh Sister and her seeker droids. Elsewhere, Kanan and Tano are attacked by the Fifth and Eighth Brothers, who engage them in a lightsaber duel. Maul and Ezra destroy the seeker droids and defeat the Seventh Sister. While the Seventh Sister is distracted by Ezra, Maul uses the Force to levitate her and holds her in a Force-choke, telling Ezra to strike her down with all of his hatred. Then the young Jedi was tempted to kill the woman. But upon realizing she is helpless and fearful, Bridger's determination disappeared. Thus, he cannot bring himself to end the inquisitor. Devoid of such mercy, Maul throws his own lightsaber at her, killing her. He then admonishes the young Jedi and tells him that in the future, his hesitation might cost him or his friends their lives.
Splitting up again, Maul tells Ezra to plant the Sith holocron in the temple's obelisk while he goes to assist Ahsoka and Kanan. Arriving at the scene, Maul engages the Inquisitors and forces the Fifth Brother onto the defensive. Capitalizing on his distraction, Ahsoka lunges forward and strikes the Fifth Brother's lightsaber, damaging it and rendering it useless. Disarmed and defenseless, the Fifth Brother is then swiftly dispatched by Maul with relative ease.
After a brief exchange with the Eighth Brother, Kanan lands a glancing blow on the Eighth Brother's lightsaber hilt, causing significant damage to the weapon. Confronted by Kanan, Ahsoka, and Maul, the Inquisitor tries to escape using his lightsaber's helicopter technique. However, the damage caused by Kanan is so severe that the weapon begins to arc both internally and externally. The blades short out completely, and the hilt begins to spark and eventually split in half in mid-air, sending the Eighth Brother falling to his demise.

Afterwards, Kanan demands to know Ezra's location from Maul. Maul claims Ezra as his apprentice, surprising Ahsoka and Kanan. Maul then uses this opportunity to strike Kanan with his lightsaber, blinding him. Before Maul can finish off the wounded Jedi, Ahsoka comes to Kanan's aid and attacks the former Sith with her white lightsabers.
While dueling Tano, Maul reveals that Ezra is on his way to activate the temple, which he intends to use as a battle station to destroy all his enemies. Meanwhile, at the temple's summit, Ezra plants the Sith holocron in the obelisk. The young Jedi is then greeted by an entity known as the "Presence," who tells him that knowledge is power. The Sith temple then begins to power up. Elsewhere, Tano pushes Maul back in their duel but stops when she notices Kanan regaining his composure, having managed to don a fallen Jedi Temple Guard's helmet and retrieve his dropped lightsaber. She mockingly tells Maul that he must defeat Kanan first before challenging her. Kanan then instructs Ahsoka to find Ezra while he deals with Maul. Despite his blindness, Kanan uses his Force powers and senses to fight Maul and succeeds in pushing him over a cliff into the chasm below.
After driving Maul away, Kanan is contacted by Chopper, who reports sighting another TIE starfighter. The wounded Kanan then instructs the astromech droid to pick them up. Back at the Sith temple's summit, the Presence reveals that the Temple possesses the power to destroy all life. When Ezra protests that this was not his intention, the Presence questions whether their new guest will claim the power. Believing the Presence is referring to Maul, Ezra attempts to warn Kanan and Ahsoka. However, as he emerges from the temple, the young Jedi is confronted by the Sith Lord Darth Vader, who has arrived in his TIE starfighter with his lightsaber ignited.

When Vader asks Ezra how he opened the holocron, the young Jedi tells the Sith Lord to figure it out himself. Dismissing it, knowing the temple's power will serve his master The Emperor, Vader quickly defeats Ezra and breaks his lightsaber in half. As Vader prepares to finish Ezra off, Ahsoka intervenes. He suggests they need not fight and that the Emperor will show her mercy if she agrees to help the Sith hunt down the remaining Jedi. In response, Ahsoka rebukes him, stating that he and his Inquisitors have killed all the Jedi. As Vader threatens her with Ezra's safety, Ahsoka expresses her outrage, stating that her former master could never be as vile as him. Vader replies that Anakin Skywalker was weak and that he destroyed him. Tano then vows to avenge Anakin's death. When Vader retorts that revenge is not the Jedi way, Ahsoka declares that she is no Jedi.
While Ahsoka engages and pushes back Vader in a lightsaber duel, Ezra decides to remove the holocron to keep it out of the Sith Lord's hands. Shortly after, he is joined by Kanan and Chopper, who have arrived with the Phantom. Ezra notices that Kanan is wearing a helmet, and his master replies that they will discuss it later. Working together, Kanan and Ezra remove the Sith holocron from the obelisk, causing the Temple to collapse and implode. Meanwhile, on the Sith Temple's outer walls, Ahsoka and Vader continue their duel until Vader forces Ahsoka over the edge into the chasm below.

Ezra and Kanan try to return to the Phantom, but Vader arrives and starts pulling the holocron towards him through the Force, with Ezra struggling to hold onto it and Kanan trying to pull Ezra back. However, Ahsoka reappears and attacks Vader, knocking away his lightsaber and damaging his helmet. With the right half of his mask destroyed, along with the voice filter malfunctioned, Vader as Anakin calls out Ahsoka's name, shocking her. Beneath the charred helmet and scarred face, Tano sees her former master. Torn by her feelings for Anakin, Ahsoka tells the fallen Jedi she would not leave him. Vader appears to consider this for a moment but ultimately replies "Then you will die," and re-ignites his lightsaber. Around them, the temple starts to seal. Ezra tries to get to Ahsoka, but she Force-pushes him out of the temple and into the Phantom. As the temple closes in on itself, Ahsoka and Vader continue their fight as Ezra, Kanan, and Chopper manage to escape Malachor on the Phantom.

As they depart, the temple explodes, engulfing the surrounding area in a burst of power, seemingly killing Ahsoka and Vader. Aboard the Phantom, Kanan comforts a weeping Ezra as they grapple with the apparent loss of their ally and mentor Ahsoka Tano. The Phantom returns to Chopper Base on Atollon, where they are greeted by Hera Syndulla, Sabine Wren, Garazeb Orrelios, Rex, and AP-5. While the others watch in silence, Hera embraces Kanan, who is wearing a white blindfold. Ezra and Rex exchange glances, sharing their sadness for Ahsoka's loss when the clone realizes she did not return. Meanwhile, Maul escapes Malachor in a stolen TIE fighter.
On Malachor's surface, a lone and damaged Darth Vader limps away from the destroyed Sith temple without Ahsoka. While the convor Morai flies overhead, Tano can be seen walking back into the temple. Back on the Ghost, the Spectres silently deal with Kanan's blindness and the apparent loss of Ahsoka. In his darkened room, Ezra accesses the Sith holocron using the dark side of the Force, with his eyes reflecting the beaming red light.
The depiction of Vader's exposed face is a reused asset from the Anakin model utilized earlier in the series. Incongruously, it features a visible eyebrow, despite the fact that Obi-Wan Kenobi burned them off long ago during their duel on Mustafar.
Ahsoka Tano recites the phrase "taka zeech ma toka duuwaj" from an obelisk in Ur-Kittât, a phrase originating from the Star Wars Legends short story A Tale from the Dark Side, penned by George R. Strayton.