Will Smith's 'Agent J' made a surprise cameo at Coachella.

2024 Coachella Valley Music And Arts Festival - Weekend 1 - Day 3
(Photo by Arturo Holmes/Getty Images for Coachella)

During Sunday's performance at the music festival, fans were treated to a surprise appearance by the 55-year-old actor, who joined J Balvin onstage.

RELATED: Will Smith, Reese Witherspoon, Jessica Alba React To Solar Eclipse

Dressed as his iconic character Agent J from the 'Men in Black' movie series, Smith emerged from the stage amid Balvin's UFO-themed set. With a black suit and shades, he greeted the crowd with a spirited "Coachella!" before launching into the titular track from the beloved 1997 film.

2024 Coachella Valley Music And Arts Festival - Weekend 1 - Day 3
(Photo by Arturo Holmes/Getty Images for Coachella)

As the song played, the 'Bad Boys' star delivered the lyrics with enthusiasm while Balvin, 38, stood beside him on stage. During the memorable dance breakdown, both artists and the accompanying dancers, decked out as agents and aliens, moved in synchronized harmony.

A video of the lively performance, shared on X (formerly Twitter), captured the entertaining conclusion. In the fun finale, dancers escorted Balvin offstage while Smith wielded a 'Neuralyzer' from the film, playfully flashing it at the crowd. Balvin swiftly returned to the stage to deliver an energetic rendition of his hit song "In Da Ghetto," accompanied by his dancers.

RELATED: Will Smith Slapped With Speeding Ticket In Malibu

2024 Coachella Valley Music And Arts Festival - Weekend 1 - Day 3
(Photo by Arturo Holmes/Getty Images for Coachella)

Amidst the electrifying performance, Smith enjoyed the support of his family members in the audience. His wife, Jada Pinkett Smith, and son, Jaden Smith, were both present, enthusiastically cheering him on. Jada even shared a video on her Instagram Stories, showcasing her singing along to the song's chorus.

Adding to the familial celebration, Willow Smith, also in attendance, joined Balvin onstage for a rendition of her track "Big Feelings."