It's a modern reunion for Sofia Vergara and Eric Stonestreet.

Vergara, 47, and her former "Modern Family" co-star Stonestreet, 48, had the chance to film together again when he served as a guest judge on Tuesday's episode of "America's Got Talent."

Both stars took to Instagram to commemorate the occasion.

NETFLIX REVIVES 'UNSOLVED MYSTERIES' WITH ITS ORIGINAL CREATORS AND 'STRANGER THINGS' PRODUCERS AT THE HELM

"What a great night!" Vergara wrote alongside a picture of her hugging her co-star. "So good to be back with @ericstonestreet!"

Similarly, Stonestreet shared a handful of photos from his time on "AGT."

"So excited to join @agt as a judge tonight! Thank you to everyone who made me feel so welcome!" he wrote. "It was great being back with the lovely @sofiavergara And thank you @heidiklum for letting me fill in for you. @simoncowell @howiemandel."

Stonestreet stepped in as a guest-judge after Heidi Klum fell ill in the early spring and will appear in a second episode as well.

'LOVE IS BLIND' STAR LC SAYS SHE HAS SPLIT FROM MARK CUEVAS AFTER A FAN OUTS HIM FOR 'DATING' ANOTHER WOMAN

"I was sad to hear Heidi wasn't feeling well, but my first reaction was, 'Yes, of course, 100 percent, absolutely. What time do I need to be there and what do I wear?'" Stonestreet told People magazine about being asked to appear on "AGT."

The actor said that reuniting with Vergara was a big draw for him.

"Having worked with Sofia for 11 years, I knew how great of a personality she has and how funny she would be on a show like AGT, because anyone who spends any time with Sofia knows she's as funny in person as she is with a script," he said.

Stonestreet also noted that Howie Mandel, 64, and Simon Cowell "lived up to well beyond my expectations."

IDRIS ELBA, QUEEN LATIFAH, MORE STARS JOIN 300 BLACK ARTISTS, EXECS ASKING HOLLYWOOD TO 'DIVEST FROM POLICE'

While his experience was positive, the actor said there was "one thing no one remembered to prepare" him for.

"I felt bad running into a couple of the people that I had to, unfortunately, say no to," he remembered.

Stonestreet said he came "face-to-face with contestants backstage both who got through and those who didn't get through."

Vergara also spoke about how Stonestreet ended up being booked on the show after Klum's illness occurred, dismissing her from production.  Klum fell ill at the beginning of the coronavirus outbreak but testing ultimately proved not to be the virus.

CLICK HERE TO GET THE FOX NEWS APP

"It was lucky that Eric was in Los Angeles and that he was available that day. And that AGT was one of his favorite shows," said Vergara. "He really was excited to do it and to be able to do it with me was great, too."