Serena Williams just confirmed her pregnancy announcement was made by accident ... but was only off by about 5 or 6 days.
The tennis star admitted to the social media flub Tuesday at a TED Talks conference in Vancouver with Gayle King -- where she said she had meant to take the pic in private ... but somehow blasted it out to the world.
Serena told Gayle ... "On social media, you press the wrong button and thirty minutes later I missed four calls and I’m like, ‘That’s weird.’"
Doesn't sound like she regrets the early announcement -- she said she was gonna publicly disclose it a few days later anyway. The news also came on the heels of her rising back to No. 1 in the women's tennis rankings ... which ain't bad for someone who hasn't played since January.
Unfortunately, it wasn't without controversy either. She had to deal with haters like former tennis pro Ilie Nastase, who made a racist comment about her future baby. Serena shut him down like a champ, though.