The leader of the X-Men hailed Justin Trudeau as a "real-life superhero" on Instagram, after the prime minister paid a visit to the set of "X-Men: Dark Phoenix" in Montreal.

Actor James McAvoy, who plays Professor Charles Xavier in the superhero franchise, posted a photo of Trudeau and the rest of the film's cast on Instagram Saturday.

"Just met 'the dude,'" McAvoy wrote. "Thank you Canada for such a progressive, impressive and somewhat suggestive real-life superhero."

McAvoy's photo shows Trudeau with several members of the film's cast and crew, including McAvoy, director Simon Kinberg, Sophie Turner (Jean Grey), Kodi Smit-McPhee (Nightcrawler), Tye Sheridan (Cyclops) and Alexandra Shipp (Storm).

Trudeau was in Montreal to visit his home riding of Papineau on Saturday, during Quebec's Saint-Jean-Baptiste holiday.

"Dark Phoenix" is the latest X-Men film to shoot in Montreal. The previous two installments in the franchise, "Apocalypse" and "Days of Future Past," were also partially shot in the city.

It's unknown whether Trudeau will make an actual cameo in the film, but it wouldn't be his first appearance in the Marvel universe. Trudeau appeared in a Marvel comic issue last year, when he offered advice to the all-Canadian superhero team Alpha Flight in "Civil War II: Choosing Sides No. 5."

The issue was written and drawn by Canadians Chip Zdarsky and Ramon Perez, who said they informed the Prime Minister's Office about their plans to include Trudeau beforehand.

The PM makes no secret of his geeky tendencies, although his love for "Star Wars" appears to trump his affection for superheroes. Trudeau once dressed up as Han Solo for Halloween, and was recently photographed wearing R2-D2 and C-3PO socks on May 4, a.k.a. "Star Wars Day."

"X-Men: Dark Phoenix" is due in theatres next year.