Mark Hamill Talks Surprise Cameo in The Mandalorian Season 2 Finale: 'A Real Triumph'

Mark Hamill is celebrating his return to the Star Wars universe.

The actor's iconic character from the film franchise, Luke Skywalker, made a surprise appearance in The Mandalorian's season 2 finale, "The Rescue," which dropped on Disney+ on Friday.

In the episode, a CGI version of Hamill's Luke Skywalker rescues Mando (Pedro Pascal) and Grogu/The Child — better known as Baby Yoda — from The Dark Troopers, sent by Moff Gideon (Giancarlo Esposito).

In a heartwarming final scene, Mando watched as Grogu departed with Luke and his longtime droid, R2-D2, to complete his Jedi training.

After the episode aired, Hamill, 69, tweeted: "The fact that we were able to keep my involvement a secret for over a year with no leaks is nothing less than a miracle. A real triumph for spoiler-haters everywhere! <#LooseLipsSinkStarships #STFU."

RELATED: Baby Yoda Has a Name! The Mandalorian Reveals Beloved Character's True Moniker

According to Deadline, Hamill made a secret cameo in the fifth episode of season 1 when he voiced the droid EV-9D9 during a scene at the Tatooine cantina.

Hamill has appeared in six Star Wars films: A New Hope (1977), The Empire Strikes Back (1980), Return of the Jedi (1983), The Force Awakens (2015), The Last Jedi (2017) and The Rise of Skywalker (2019).

RELATED: Hayden Christensen to Return as Darth Vader Alongside Ewan McGregor in Upcoming Obi-Wan Kenobi Series

The Mandalorian season 2, which premiered on Oct. 30, follows Mando and Grogu continuing their intergalactic adventures. The titular character continues to seek out other Mandalorians while protecting his extraterrestrial charge from those who might want to harm him for the sake of army-building research.

The series takes place in the time between the end of the original trilogy and The Force Awakens and stars Pascal, Gina Carano, Carl Weathers, Giancarlo Esposito, Werner Herzog, Nick Nolte, Emily Swallow and Omid Abtahi.

The first season earned rave reviews from critics, even nabbing an impressive 15 Emmy awards, including outstanding drama series.

The Mandalorian is now streaming on Disney+.