Britney Spears vividly remembers being a bundle of nerves when she ran into her ex-boyfriend Justin Timberlake backstage at the 2007 MTV Video Music Awards.

“It had been a while since I’d seen him,” the Princess of Pop writes in her new memoir, “The Woman in Me,” which hit stores Tuesday.

“Everything was going great in his world. He was at the top of his game in every way, and he had a lot of swagger. I was having a panic attack. I hadn’t rehearsed enough. I hated the way I looked. I knew it was going to be bad.”

Spears had been set to perform her song “Gimme More” at the awards show following a series of headline-making personal struggles, including her divorce from Kevin Federline and infamous head-shaving incident.

However, the Grammy winner remembers not wanting to take the stage because “nothing was going right” behind the scenes.

“There was a problem with my costume and with my hair extensions. I hadn’t slept the night before. I was dizzy. It was less than a year since I’d had my second baby in two years but everyone was acting like my not having six-pack abs was offensive,” she writes.

Britney Spears and Justin Timberlake
Britney Spears recalls running into her ex Justin Timberlake backstage at the 2007 VMAs in her new memoir.Getty Images
“I couldn’t believe I was going to have to go out onstage feeling the way I felt.”

Spears ultimately went through with the performance, only for critics to pan her appearance, lackluster choreography and lip-synching.

“I went out there and did the best I could at that moment in time, which — yes, granted — was far from my best at other times,” she admits. “I could see myself on video throughout the auditorium while I performed; it was like looking at myself in a fun-house mirror.”

Britney Spears
Spears writes that “nothing was going right” prior to her “Gimme More” performance.REUTERS

Justin Timberlake
She remembers Timberlake having a much better night.Jesse Grant/WireImage.com
It didn’t help that Timberlake was having a stellar night, taking home awards including Male Artist of the Year and delivering a star-studded performance with Timbaland, Nelly Furtado and other artists.

“Justin glided down the runway,” Spears recounts. “He was flirting with girls in the audience, including one who turned around and arched her back, shaking her breasts as he sang to her.”