Lance Bass came out to Britney Spears way before he publicly announced that he's gay.

The former *NSYNC star shared the story of his coming out during his appearance on Monday's episode of "Watch What Happens Live With Andy Cohen," revealing that he opened up about his sexuality to Spears following her shotgun wedding to childhood friend Jason Alexander in January 2004.

"I remember you telling me that Britney Spears was the first person -- one of the first people -- who you came out to," Cohen said to Bass.

"Yes. It was the night that she got married the first time in Vegas to Jason. So I went up to Vegas to kind of see the craziness that was happening. And she was a little upset once she realized what she had done because, you know, it was a funny thing," Bass recalled. "And then she started, like, really crying and, like, she was so upset."

Spears infamously tied the knot at a Las Vegas wedding chapel and got the marriage annulled 55 hours later.

"And so I took her to her room and we were sitting on her bed and she wouldn't stop crying, so I was like, 'I'm gay,'" Bass went on. "And it made her stop crying... She chuckled."

Bass, 40, and Spears, 37, had been friends for years, as they both came up in the music industry together at the turn of the millennium. Spears also dated Bass' bandmate, Justin Timberlake, for three years a the height of *NYSYNC's fame.

The pop star, who is now married to Michael Turchin, would go on to wait two more years before publicly coming out as gay on a July 2006 cover of People magazine.

6 PHOTOS Britney Spears & boyfriends through the years See Gallery Britney Spears & boyfriends through the years UNITED STATES - SEPTEMBER 28: Britney Spears sits at a screening of 'Drive Me Crazy' at Union Square Theater with Robbie Carrico. (Photo by Richard Corkery/NY Daily News Archive via Getty Images) LAS VEGAS - DECEMBER 08: Musician Britney Spears and husband Kevin Federline arrive at the 2004 Billboard Music Awards at the MGM Grand Garden Arena on December 8, 2004 in Las Vegas, Nevada. (Photo by Frazer Harrison/Getty Images) Britney Spears arrives with her boyfriend Adnan Ghalib (R) at the Los Angeles County Superior courthouse 14 January 2008 for a hearing regarding visitation rights for her two sons that she has with ex-husband Kevin Federline. AFP PHOTO/Gabriel BOUYS (Photo credit should read GABRIEL BOUYS/AFP/Getty Images) Jason Trawick (L) and Britney Spears arrive at the 2011 MTV Video Music Awards (VMAs) August 28, 2011 at the Nokia Theatre in downtown Los Angeles, California. AFP PHOTO / Frederic J. Brown (Photo credit should read FREDERIC J. BROWN/AFP/Getty Images) LOS ANGELES, CA - SEPTEMBER 11: Singer Britney Spears (L) and fiance agent Jason Trawick appear at the premiere of Fox's 'The X Factor' Season 2 and handprint ceremony at the Chinese Theatre on September 11, 2012 in Los Angeles, California. (Photo by Kevin Winter/Getty Images) WEST HOLLYWOOD, CA - MARCH 02: Recording artist Britney Spears (L) and David Lucado attend Neuro at the 22nd Annual Elton John AIDS Foundation Academy Awards Viewing Party at The City of West Hollywood Park on March 2, 2014 in West Hollywood, California. (Photo by Charley Gallay/Getty Images for Neuro) Up Next See Gallery Discover More Like This HIDE CAPTION SHOW CAPTION of SEE ALL BACK TO SLIDE

More from :

Jimmy Kimmel dumbfounded as movie stars crash his monologue: 'Can I help you?'

Seth Meyers rips into the Republicans dodging questions about Donald Trump's racist tweets

Nicki Minaj took Jimmy Fallon to Red Lobster