In one of the more unusual events at Monday night's Grammy Awards, "Modern Family" star Sofia Vergara surprised the audience when she walked out on stage during Pitbull's closing performance. The actress joined Robin Thicke, Joe Perry and Travis Barker onstage for the performance of Pitbull's latest song "El Taxi."

"I'm talking Caribbean Queen you a bronze Jamaican / and Colombians you guessed it in Queens," he sang during the rhythm-driven song, according to Us Weekly. "She's fine, that's something you've never seen / She's fine like something straight out of a magazine / She's fine like Sofia Vergara."

After the rapper said the lyric, the 35-year-old actress walked out on stage with a taxi costume and hat on, only to later reveal a short, sexy gold sequined dress. After she shed her costume, Vergara proceeded to shake her hips to the song.

While some people may have thought of Vergara's appearance as random, the two are actually old friends, according to The Huffington Post. The Florida rapper performed at the wedding of Vergara and her husband Joe Manganiello in Palm Beach, Fla. in December 2015.

"That was a lot of fun. Big congratulations to Joe and Sofia," Pitbull told E! News after the couples big day. "Sofia knows how to have a great time so by the time I was on the third song, she was like a general."

Check a portion of Vergara's special appearance during Pitbull's performance below: