Williams, the No.1 seed and 2013 champion, was set to play Klara Koukalova in the second round.
"I was having some pain in my right elbow," the World No.1 told reporters at a press conference.
"I felt it a little bit in my match yesterday, and then it got better, but then this morning I really couldn't hit serves, and if I'm not able to hit serves that could definitely be a problem. So I talked to my coach about it and we were like, 'Let's see what the doctor says, and see what everyone else says, and go from there.' The main thing is that we don't want it to get worse, we obviously want it to heal.
"Unfortunately I haven't had time to heal. I've been going, going, going, playing tournaments I love, and coming here has been such a great joy, but unfortunately it's not going to heal if I keep playing."
What's Williams going to do next? "I'm going to take some time off, I'm going to get some treatment, and I'm going to continue to do things for it. I'll do what's best for my body and continue from there.
"This was a really difficult decision, and uncomfortable, because if you know me, you know I really wanted to come here. I love being here and I feel like I'm on vacation here, and it's just a wonderful time. It was a really tough decision, but unfortunately I think I had to make the hard decision."
She might stick around for a bit, though.
"I'm in no hurry to leave Bastad. I love this city. Hopefully I'm welcome to stay a few more days!"
Williams is scheduled to return to action for her beloved summer hardcourt season, currently entered in Stanford, Toronto and Cincinnati before going for her fifth Grand Slam title in a row in New York.
Three other second round matches took to the clay earlier in the day, with No.3 seed Barbora Strycova outdoing Evgeniya Rodina, 6-4, 6-1, Swedish wildcard Rebecca Peterson upsetting No.6 seed Katerina Siniakova, 7-5, 7-6(6), and Yulia Putintseva getting past French qualifier Alizé Lim, 6-0, 1-6, 6-2.