"Modern Family" star and sex symbol Sofia Vergara avoided what could have been an embarrassing moment at the 2012 Emmy Awards, just before she took the stage to join her cast members and accept the top "Outstanding Comedy Series" prize.

The 40-year-old Columbian actress had worn a sequined teal Zuhair Murad mermaid gown with front and back cut-outs to the ceremony on Sunday, September 23.

"20 min Modern Family won!! Dress malfuncion !!! Thank you emergency team!!! (sic)" she said on her WhoSay page, under a photo of a woman sewing up part of her gown in the butt area.

Vergara, who is known for her playful attitude and sense of humor, then posted a closer picture that showed the damage - it appeared that a zipper had burst, showing off part of her behind and a lacy, white thong peeking through (check it out here - warning: Explicit content - NSFW)

Yes!!!! This happend 20 min before we won!!!!" she said. "Jajajajja. I luv my life!!!!"

Her co-star, Sarah Hyland, posted another photo of Vergara's behind on her own WhoSay page, saying: "I could look at this for the rest of my life..."

On "Modern Family," Ed O'Neill plays Jay Pritchett, the patriarch of an eclectic family. Vergara plays his younger, sexy, second wife. Jesse Tyler Ferguson plays Pritchett's son and he and Eric Stonestreet's character are a homosexual couple raising a Vietnamese daughter. Julie Bowen plays Pritchett's daughter and Ty Burrell portrays her husband.

"Modern Family" was nominated for 14 Emmys this year and won four, including Outstanding Supporting Actor In A Comedy Series for Stonestreet. Vergara was nominated for Outstanding Supporting Actress In A Comedy Series but lost to Bowen. "Modern Family" has received 45 nods since its 2009 debut. The show returns for a fourth season on September 26.

The 2012 Emmy Awards ceremony was held at L.A. Live's Nokia Theatre in Los Angeles on Sunday, September 23 and aired on ABC. The event was hosted by Jimmy Kimmel, who also hosts the network's hit late-night talk show "Jimmy Kimmel Live!."