WARNING: The following contains spoilers for the Star Wars: The Clone Wars Season 7 episode "Shattered," streaming now on Disney+.

For its final arc, Star Wars: The Clone Wars at long last depicted the fabled Siege of Mandalore, with Darth Maul making his long-awaited return to the series. The renegade Sith Lord faced Ahsoka Tano in battle, and revealed he knew about his former master's plan for Anakin Skywalker. With events only days away from Order 66 and the fall of the Jedi, these final episodes have carried with them a sense of impending dread. After all, it was only a matter of time before the faithful clone troopers would turn on Ahsoka.

Of course, we knew she would (somehow) survive the purge, because she went on to play a central role on Star Wars Rebels. What we didn't know was how. Now, in The Clone Wars' penultimate episode, "Shattered," the worst comes to pass: Palpatine triggers Order 66, and the clones follow through with his plan.

And, yes, Ahsoka survives -- in large part because of a shoutout to Rogue One: A Star Wars Story.

RELATED: The Clone Wars Drops A MAJOR Solo: A Star Wars Story Easter Egg

Rex and Ashoka

In "Shattered," Ashoka leaves Mandalore with her squadron of clone troopers, and they return to their Star Destroyer, with a captured Maul in tow. But as the set a course for Coruscant, Rex receives the message from Darth Sidious. Because of their inhibitor chips, the clone troopers don't hesitate to open fire on Ahsoka -- well, all of them except Rex, who shows signs of resistance.

For the remainder of the episode, Ashoka evades the clone troopers, who destroyed the vessel's escape pods on Rex's orders. With help from some droids, Ashoka learns about the inhibitor chips, and makes a desperate move to save Rex (and herself). After isolating him from the other troopers, Ahsoka takes the unconscious Rex to a medical bay, where she instructs the droids to locate and remove the chip.

However, the scans don't reveal its location. With other clones closing in fast, Ahsoka places her hands on Rex's head and whispers: "I am one with the Force, and the Force is with me," over and over again.

It's clear her powers begin to have an effect on Rex, who mutters the mantra along with her, even in his unconscious state. That's enough to reveal the chip, which the droids promptly deactivate. Then, just as the clones are about to kill Ahsoka, Rex wakes up and helps Ahsoka to fend off her attackers.

RELATED: The Clone Wars' Next Episode Could Leave Rex In A Heartbreaking Position

Chirrut Imwe surrounded by unconscious stormtroopers in Rogue One: A Star Wars Story

The line that helps save Rex is lifted from Rogue One: A Star Wars Story, in which Chirrut Imwe, a Guardian of the Whills, embraces the mantra as part of his spiritual connection to the Force. He may not be a Jedi, or have powers derived from the Force, but he believes in it -- and that is enough for him.

Streaming on Disney+, the final season of Star Wars: The Clone Wars stars Matt Lanter as Anakin Skywalker, Ashley Eckstein as Ahsoka Tano, Dee Bradley Baker as Captain Rex and the clone troopers, James Arnold Taylor as Obi-Wan Kenobi, Katee Sackhoff as Bo-Katan and Sam Witwer as Maul. A new episode arrives each Friday.

KEEP READING: Star Wars: The Clone Wars' Most Divisive Arc Is Better Than You Remember