"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," Favreau said Monday during an appearance on "Good Morning America."
"Every piece of casting leaked," he added. "We were so scared right up 'til it aired that our surprise cameo was gonna leak, too."
On the finale, Luke's familiar X-Wing flies aboard Mof Gideon's ship. A cloaked Jedi emerges. Obscured from view, he easily cuts down Gideon's elite Dark Troopers.
While "Star Wars" fans likely figured out it was Luke from shots of a recognizable gloved hand and green lightsaber, the Jedi didn't confirm his identity until removing his hood in front of Mando and Bo-Katan.
Advertisement
The episode's credits confirmed that Mark Hamill reprised his role as Skywalker.
On "GMA," Favreau said Hamill was on set of "The Mandalorian" filming his cameo. Lucasfilm then used technology to "de-age him and make him look as much as he looked in the old films."
Despite Favreau's fears, Lucasfilm was previously able to keep some secrets such as Baby Yoda and his real name, Grogu, which was revealed earlier on season two.
Favreau credited that to not sharing the information with too many people and by holding back on merchandise, which may have spoiled the big moments.
For fans waiting for season three, Favreau said the next installment of "The Mandalorian" is currently in pre-production. During his "GMA" appearance, Favreau said that will start production after the newly-announced Boba Fett series, "The Book of Boba Fett," completes production.
NewsletterSIMPLY PUT - where we join the dots to inform and inspire you. Sign up for a weekly brief collating many news items into one untangled thought delivered straight to your mailbox.