Melissa McCarthy recently surprised Mariska Hargitay by turning up on set to film her guest appearance on Law & Order: Special Victims Unit.

During Thursday's episode of the long-running police procedural show, the Bridesmaids star makes a guest appearance as flirty pro fighter Jasmyn Jewell, whom Hargitay's police captain Olivia Benson taps for information about a murder case at an expo.

In an Instagram video, McCarthy revealed that she and the SUV team went to great lengths to keep her guest appearance from the show's leading lady, such as having McCarthy arrive on location in a mask.

After transforming into Jasmyn, complete with mullet and wrestling belt, the Spy star walked onto the expo set and surprised Hargitay.

Looking stunned, the actress yelled, "Holy mother of Christ! Are you f**king kidding me? Oh my God!!"

After giving McCarthy several big hugs, Hargitay said, "I can't believe this. I can't believe it. This changes all the dialogue! The scene's gonna go differently."

She continued, "I'm in shock right now. I can't remember the last time I was surprised like this. I'm so happy right now, I don't know what to do."

In the scene, Jasmyn sits at a booth at the expo while Olivia asks questions about the murder victim, who attended the event on the day he died. Instead of cooperating, Jasmyn flirts with Olivia and urges her to hand over some money.

"If you're a little low on funding, we can make some kind of arrangement. I know my way around a pair of handcuffs, if that floats your boat," she says, according to Variety.

Afterwards, Olivia offers up some cash and Jasmyn recalls her brief interaction with the murder victim.

At the end of the Instagram video, Hargitay jokingly puts McCarthy in handcuffs, and she quips, "Gladly, I've been thinking about this for years."

In the caption, the funnywoman revealed that her surprise was "six years in the making".

"Turns out it is VERY hard trying to keep secrets from @therealmariskahargitay on her set but we managed to pull it off and in a world where things are heavy and dark but this day was PURE JOY," she wrote. "Mariska, you are the real deal. Sorry everyone lied to you, hope it was worth it."

Hargitay replied in the comments, "WORTH THE WAIT."

She also posted a selfie with McCarthy from the set and wrote, "SURPRISE!!!! #MELISKA mind blown and still doing the happy dance!"

LATEST NEWS