Former 'NSYNC member Lance Bass came out to Britney Spears the night she married Jason Allen Alexander in 2004, he revealed this week.

Speaking on “Watch What Happens Live with Andy Cohen” on Monday, the former boyband member explained why he came out to Spears two years before his memorable People magazine cover in 2006, when he revealed his sexual identity to the world.

MTV VMAS 2019: ARIANA GRANDE AND TAYLOR SWIFT SCORE 10 NOMINATIONS EACH

"It was the night that she got married the first time, in Vegas ... to Jason," Bass began, referring to when Spears wed Alexander. The two were famously husband and wife for 55 hours before their marriage was annulled.

"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. And then she started, like, really crying and she was so upset,” he continued.

After failing to console the “Toxic” singer, Bass had an idea: Perhaps he could stop her from crying by using a shock factor.

"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!'" he said.

The idea was a success, Bass said.

Lance Bass and Britney Spears.

Lance Bass and Britney Spears. (Getty)

“It made her stop crying,” he continued, noting Spears then let out a “chuckle."  Bass said Spears was supportive.

BRITNEY SPEARS, SAM ASGHARI MAKE RED CARPET DEBUT AT 'ONCE UPON A TIME IN HOLLYWOOD' PREMIERE

Bass felt “liberated and happy" after coming out, he told People in 2006.

“The main reason I wanted to speak my mind was that [the rumors] really were starting to affect my daily life. Now it feels like it’s on my terms. I’m at peace with my family, my friends, myself and God so there’s really nothing else that I worry about,” he added at the time.