Britney Spears gave a lengthy explanation about how she got locked in a bathroom in the middle of the night on Tuesday.

The 39-year-old musician went into detail on Instagram about how she accidentally locked herself in and how she ended up getting out via help from her boyfriend Sam Asghari and security.

"At 2am I decided to take a bath !!!!," Spears captioned a photo of a brown wooden door. "I got a new scented lotion from Victoria’s Secret and I wanted to wear it because it helps me sleep better !!!!"

Spears went on to explain that "the lock was stuck" and she "got locked in the f--king bathroom" while Ashgari "was sleeping." "Even if there are earthquakes he doesn't wake up," the "Gimme More" singer added of Asghari, 27.  

BRITNEY SPEARS HAPPILY PETS POTBELLIED PIG IN HAWAII WITH BOYFRIEND SAM ASGHARI AMID CONSERVATORSHIP BATTLE

Britney Spears shared a lengthy story about how she got locked in a bathroom in the middle of the night Tuesday on her Instagram.  (Getty Images)

Asghari eventually did wake up, according to Spears, and ended up calling security. However, the security team took a long time, Spears wrote.

CLICK HERE TO SIGN UP FOR THE ENTERTAINMENT NEWSLETTER

"I just looked at it for the first time with a yearning of just wanting it to open … would my eyes trick me and make it happen faster ??? My eyes widened and the door was more clear … more vast … I could see it with clarity and brightness … please open door," the "…Baby One More Time" singer said about her time waiting for security to show up. 

"'We’re here!' They said … I asked how long it would take to open … and they said "oh, maybe 10 minutes" !!!!" Spears continued. "The old coffee I had left over from the morning was there … I started feeling foggy so I drank it ... I was reenergized and started speaking again!!! "Are you guys there ???" … "Yes we are!" They said, "Stand back, we’re going to open the door!" 

"It opened … it finally opened !!!!!" she concluded.

CLICK HERE TO DOWNLOAD THE FOX NEWS APP

Spears and Asghari are spending time together in Hawaii amid the pop star's ongoing conservatorship battle.