Cavill, who recently starred as the Man of Steel in Batman v Superman: Dawn of Justice, waited in line to get an autograph from Smith, who was at SDCC promoting his upcoming comic book epic Suicide Squad.
The 33-year-old British actor hid his identity under a Guy Fawkes mask (as worn by the eponymous anti-hero in V for Vendetta), and posed for a photo with Smith, who had no idea he was anyone but a normal fan.
As they posed together, Cavill pulled off the mask to reveal his true identity, which threw Smith for a loop before he recognized Cavill, causing him to break out into his famous, baritone laugh.
Cavill documented the prank in an Instagram video, showing him walking around the convention, posing with fans in Batman v Superman gear and waiting to see if anyone recognized him.
"Best Comic Con yet. I got to be here for Justice League but couldn't miss Suicide Squad," Cavill captioned the hilarious clip.
The first trailer for Cavill's upcoming Justice League team up (which doesn't actually feature any footage of the handsome star) debuted at SDCC on Saturday. Smith's Suicide Squad, which also stars Jared Leto, Margot Robbie, Jai Courtney and Cara Delevingne premieres Aug. 5.