[Editor’s note: Spoilers for The Mandalorian Season 2 finale follow below.]

The Mandalorian is a show that’s chock full of surprises, but perhaps its biggest surprise came in the Season 2 finale. As Mando and his cohorts appeared to be cornered by virtually indestructible Dark Troopers, a rogue Jedi appeared, laying waste to the enemies and saving their butts. That Jedi? None other than Luke Skywalker himself, played by Mark Hamill!

In hindsight, given that The Mandalorian Season 2 finale was shot a year ago, it’s crazy the production was able to keep this secret cameo under wraps for so long. And now executive producer/creator Jon Favreau has broken his silence on the appearance, admitting to GMA that every other piece of Season 2 casting had leaked previously and they were worried that Luke’s appearance would get out:

“It was very tricky because it’s very hard to keep a secret nowadays, especially with Star Wars because people are so curious about it. And there are so many people involved with the process with visual effects finishing, making it, filming it, the studios everything. Every piece of casting leaked, and we were so scared right up until it aired that our surprise cameo was gonna leak too.”

Luke Skywalker stands aboard Moff Gideon's light cruiser
Image via LucasFilm

Favreau recalled how the show kept its central premise – that the series follows The Mandalorian caring for and carting around Baby Yoda – a secret until the first episode aired, and noted how nice it was to be able to present another secret as big as that one in the Season 2 finale:

“We started off the whole series with the Baby Yoda reveal – with the Grogu reveal – that was a secret that everybody was really blown away by. Part of that is not telling too many people, not having merchandise that’s being tooled up and announced and everything. And then the very last episode having Mark Hamill actually on set filming and us using whatever technology we had available to de-age him and try to make him look as much like he did in the old films.”

Indeed, Hamill was on set to shoot his Mandalorian Luke Skywalker cameo, but significant de-aging was done to bring back the Luke Skywalker from the Return of the Jedi era. It’s unclear if Hamill will return when The Mandalorian Season 3 airs now that he’s in possession of Baby Yoda, but with production on the next season set to get underway next year, here’s hoping Favreau and Co. have another huge surprise in store that they’re able to keep under wraps.