Britney Spears and Justin Timberlake famously dated from 1999 to 2002, and now, in her upcoming memoir, "The Woman in Me," the pop star alleges that during their relationship, she became pregnant. 

Spears says that after Timberlake learned the news, he convinced her to have an abortion.

"It was a surprise, but for me, it wasn’t a tragedy," Spears wrote in an excerpt shared exclusively with People. "I loved Justin so much. I always expected us to have a family together one day. This would just be much earlier than I’d anticipated."

BRITNEY SPEARS BASHES POLICE FOR CONDUCTING WELFARE CHECK AFTER VIRAL KNIVES VIDEO: ‘ABOUT POWER FOR COPS’

A photo of Justin Timberlake and Britney Spears

Justin Timberlake and Britney Spears broke up in 2002. (Dave Hogan/Getty Images)

She continued, "But Justin definitely wasn’t happy about the pregnancy. He said we weren’t ready to have a baby in our lives, that we were way too young."

"If it had been left up to me alone, I never would have done it. And yet Justin was so sure that he didn’t want to be a father."

Spears writes that in the end, she decided to go along with Timberlake's wishes.

BRITNEY SPEARS SHOWS NEW SNAKE TATTOO WHILE ENJOYING A WESTERN RETREAT WEEKEND

Britney Spears and Justin Timberlake wearing denim outfits at the American Music Awards

Britney Spears and Justin Timberlake first met while filming "The All New Mickey Mouse Club." (Jeffrey Mayer/WireImage)

"I’m sure people will hate me for this, but I agreed not to have the baby. I don’t know if that was the right decision. If it had been left up to me alone, I never would have done it. And yet Justin was so sure that he didn’t want to be a father."

LIKE WHAT YOU’RE READING? CLICK HERE FOR MORE ENTERTAINMENT NEWS

The singer confessed, "To this day, it’s one of the most agonizing things I have ever experienced in my life."

Reps for Timberlake did not immediately respond to Fox News Digital's request for comment.

Britney Spears in a red dress and silver choker on the red carpet

Britney Spears wrote about her relationship with Justin Timberlake in her upcoming book, "The Woman in Me." (Valerie Macon/AFP)

Spears and Timberlake met while appearing on the Disney Channel's "The All New Mickey Mouse Club" when they were children. Though they were both barely preteens at the time, Timberlake later told GQ, "I was in love with her from the start. I was infatuated with her from the moment I saw her."

CLICK HERE TO SIGN UP FOR THE ENTERTAINMENT NEWSLETTER

After the show ended, they went their separate ways, but they soon found their own respective paths to pop superstardom – and back to each other.

A photo of Britney Spears and Justin Timberlake

Justin Timberlake and Britney Spears have spoken kindly about each other after their breakup. (Denise Truscello/WireImage)

In 1999, the year Spears released "… Baby One More Time" while Timberlake was riding high as the heartthrob in immensely popular boy band NSYNC, the two began dating. In 2002, when she was 20 and he was 21, they broke up.

CLICK HERE TO GET THE FOX NEWS APP

Spears went on to have two children, sons Sean, born in 2005, and Jayden, born in 2006, with ex-husband Kevin Federline.

Timberlake shares sons Silas, 8, and Phineas, 3, with wife Jessica Biel.