The season 2 finale of The Mandalorian surprised viewers with the sudden appearance of Luke Skywalker, who saved Din Djarin and his allies from certain death by cutting down Moff Gideon’s entire platoon of dark troopers. Luke was led to the heroes by Grogu, who had used the Force on Tython to summon Luke. With Grogu finally safe from Gideon’s Imperial remnant faction, Luke offers to take Grogu with him and train the Force-sensitive child as a true Jedi, which Din reluctantly agrees to. The Mandalorian’s second season finale takes place five years after Return of the Jedi, and Luke Skywalker had been on many adventures during those five years.

In the original Star Wars timeline with the Expanded Universe (now known as Legends), Luke continued to grow after the Battle of Endor. He made plenty of mistakes and lost many battles, but he learned from his failures and created the New Jedi Order, which improved upon the prequel-era Jedi Order. Luke Skywalker himself became one of the most powerful Force-users in the galaxy, but he remained humble because his love and compassion for his friends, family, and the people of the galaxy always remained his greatest strength. In canon, however, Luke did not learn from his failures and ultimately repeated the same mistakes as his mentors, leading Luke to go into exile for a time, believing that there shouldn’t be a Jedi Order anymore. Thanks to his old master Yoda and aspiring Jedi Rey, he had a change of heart and sacrificed himself to save the Resistance.

Related: The Mandalorian Season 2 Cast Guide Every New Character

In Legends, Luke helped the Rebellion transition into the New Republic in the five years after Return of the Jedi. Notably, one of Luke’s greatest adversaries, the Dark Lady of the Sith Lumiya, rose to power in the months following Palpatine’s first death. Lumiya created the next iteration of Sith and was the mastermind behind many of Luke’s dark side-wielding enemies in the years to come. After the bloody Battle of Mindor, Luke leaves the New Republic military in an official capacity, opting to focus on rebuilding a new Jedi Order and help other Force users on the path toward Jedi knighthood, such as Kyle Katarn during his quest for the Valley of the Jedi. Five years after Return of the Jedi in Legends, Luke helped the New Republic defeat Grand Admiral Thrawn and redeem the former Sith (and Palpatine’s adopted daughter) Mara Jade.

Fighting a Gorax

Very shortly after the Rebels’ victory on Endor, Luke and Leia assist their Ewok allies in fighting a Gorax, a gigantic predator that the Ewoks fight against with deadly booby traps (which were repurposed for the Imperial forces during the Battle of Endor). Using the Force and his lightsaber, Luke distracts the beast as Leia and the Ewoks set up a swinging log trap. Luke gives Leia his lightsaber to spring the trap, successfully incapacitating the gargantuan predator. Leia’s use of Luke’s lightsaber foreshadows her eventual Jedi training and the construction of her own lightsaber.

Recovering a Jedi compass on Pillio

LLuke speaks with Del Meeko in Battlefront II 2

Less than a year after Return of the Jedi, Luke travels to the aquatic Core world of Pillio, seeking a Jedi artifact from one of Palpatine’s Observatories. Finding a large Imperial ground force already there, Luke swiftly defeats them, except for one: The Inferno Squad Member Del Meeko, who doesn’t attack Luke. In an unlikely alliance, the Jedi and Imperial Special Forces agent fought off the planet’s native Scritters and reached the Observatory, allowing Luke Skywalker to recover the artifact, a Jedi Star Compass. Luke also showed Meeko that the Jedi are not to be feared and that he could live a better life than that of an Imperial. Luke helped motivate Meeko to eventually leave the Empire and protect the people of the galaxy as a member of the New Republic.

Training Leia as a Jedi

Luke and Leia train together in a flashback in The Rise Of Skywalker

Luke also began training his sister Leia as a Jedi less than a year after the Battle of Endor. On the jungle world of Ajan Kloss, Luke helped Leia hone her skills in using the Force and taught her how to use a lightsaber, with Leia building her own lightsaber eventually. Like her brother, Leia had incredible aptitude in both disciplines, and she quickly became a comparable Jedi to Luke. Leia decided to end her training and leave the path of the Jedi after having a vision of her (at the time unborn) son dying at the end of her journey. She also gave Luke her lightsaber, which he kept safe, even during his exile at the end of his life. Leia’s lightsaber would later be wielded by Rey during the Battle of Exegol, where the weapon, along with the spirits of past Jedi (including Leia and Luke) allowed her to defeat her grandfather, Palpatine, once and for all.

Related: All Star Wars Movies, Ranked Worst To Best

Saving Force-sensitive Trees on Vetine

On another mission to acquire stolen Jedi artifacts, Luke journeyed to an Imperial base on Vetine, accompanied by R2-D2 and Shara Bey (the mother of future Resistance pilot, Poe Dameron). The artifacts were fragments of the Force-imbued uneti tree that once grew in the training grounds of the Jedi Temple on Coruscant. The three worked together to defeat the Imperial forces there, and Luke successfully retrieved the two tree fragments. Luke gave one fragment to Bey, who planted it outside her home on Yavin IV (which Poe Dameron would play near as a child) and kept the other for himself. It’s possible that Luke’s tree fragment would later grow into the hollow uneti tree outside of the First Jedi Temple on Ahch-To.

Fighting in the Battle of Jakku (allegedly)

Luke Skywalker and a Sandtrooper at the Battle of Jakku

In the anthology book The Legends of Luke Skywalker, an Imperial Star Destroyer’s gunner believes that his ship was brought down by Luke Skywalker, but the trauma of the crash and his own fear of the Jedi may have made him imagine Luke’s involvement in the Star Destroyer’s crash-landing. The gunner also saw what appeared to have been Luke helping him and other survivors get to safety. If true, this behavior is in-character for Luke. The Battle of Jakku ended with the official defeat of the Galactic Empire, and Luke would naturally try to save those he’s no longer at war with.

Laying the Groundwork for Rebuilding the Jedi Order

Luke Skywalker Ben Solo Lor San Tekka

After the official defeat of the Empire (Imperial remnant factions notwithstanding), Luke continued to seek out tomes and artifacts related to the Jedi Order in his quest to rebuild it. One of Luke’s greatest allies was Lor San Tekka, an explorer who preserved Jedi history, philosophy, and belongings during the age of the Empire. Luke and San Tekka collected many sacred Jedi texts and even discovered the location of the First Jedi Temple on the forgotten world of Ahch-To. During this time, Luke learned of the many heroic members of the old Jedi Order, and evidently the many mistakes the Order made during the prequel era as well. Despite this, Luke continued to work towards training a new generation of Jedi, and one of the first Force-sensitives he ended up finding was the child Grogu, as shown in the season 2 finale of The Mandalorian. Luke’s attempts to rebuild the Jedi Order were eventually thwarted by Leia’s son, Ben Solo (now Kylo Ren), leaving Grogu’s fate unknown.

Next: Everything We Know About The Mandalorian Season 3