In Season 2 of The Mandalorian, the bounty hunter Din Djarin’s goal was to find a Jedi to train Baby Yoda/Grogu, and series creator Jon Favreau revealed that it wasn’t always certain that the Jedi would be Luke Skywalker.

"The story unfolded as I wrote it," Favreau said in an interview with WGA. "The Mandalorian inherits a great deal from existing Star Wars stories, and when I write, that context is always a consideration. It became clear that, within the established continuity, certain things were likely to transpire."

RELATED: The Mandalorian Season 3 Expected to Begin Production This Spring

In The Mandalorian's "Chapter 13: The Jedi", Din arrives on Corvus and confronts the Magistrate, Morgan Elsbeth, who has overtaken a city. She requests that Din kill Ahsoka Tano, a Jedi who was trained by Anakin Skywalker, and offers the powerful Beskar staff in return. When Din finds Ahsoka, he instead asks for help in training Grogu, but she refuses after noticing the connection the two share. She advises them to go to the seeing stone on the planet Tython where Grogu can send out a signal for another Jedi to train him.

The finale of The Mandalorian Season 2 ended with Luke Skywalker, in his black cloak post-Return of the Jedi, cutting down a swarm of Dark Troopers aboard Moff Gideon's light cruiser. He finally gets to Grogu and saves Din's team in a touching scene. Mark Hamill reprised the role (with de-aging VFX technology) in a very well-kept secret that rocked the internet.

RELATED: The Mandalorian's Katee Sackhoff Found Out About Luke Skywalker's Cameo the Same Way You Did

Luke Skywalker seemed like a very likely candidate, based on his massive popularity and his connection with Yoda, a Jedi master who is the same species as Grogu. Yoda trained the young Skywalker in the swamp planet Dagobah, similar to how Ahsoka briefly trained Grogu, but Favreau confirmed that Luke's inclusion wasn't a clear plot point from the beginning.

Created by Jon Favreau, The Mandalorian stars Pedro Pascal, Gina Carano, Carl Weathers and Giancarlo Esposito. Seasons 1 and 2 are now streaming on Disney+.

Source: WGA