Paula Badosa jokingly claimed "ruined her birthday" after losing to the world No. 2 at the Billie Jean King Cup Finals.
Spain finally took on Poland for a place in the quarter-final after their knockout tie was postponed due to severe weather.
But it didn't go as planned for the home team playing in Malaga as Swiatek sealed victory for Poland, putting them through to the last eight.
Badosa celebrated her 27th birthday on the match court, representing Spain in the BJK Cup finals. But the world No. 12 had a tough task on her hands as she faced Swiatek in a must-win rubber.
Poland's Magda Linette beat Sara Sorribes Tormo in a three-hour and 50-minute epic in the first match of the tie. It meant Badosa had to beat Swiatek to keep Spain alive in the competition and force a decisive doubles contest.
The birthday girl came from a set down against the five-time Grand Slam champion to take the match to a decider. But she couldn't get the job done and Swiatek won 6-3 6-7(5) 6-1, sending Spain out of the competition.
The pair shared a warm embrace at the net but Badosa later took to Instagram to jibe Swiatek in defeat. "Too good @iga.swiatek thank you for ruining my birthday," she wrote on her story, adding a laughing emoji.
"It was very nice to share the court with you again. You made me realise I still need to work my a** off a bit more. Keep inspiring."
Swiatek reposted the story and wrote: "Thank you @paulabadosa. It's such a privilege to share [the] court with you."
Badosa is still taking the positives from her defeat. The Spaniard spent six months sidelined with a back injury at the end of last season. She struggled when she returned to competition this year and doctors told her it would be very difficult to continue her career.
But she suddenly rediscovered her best tennis over the summer, winning the title in Washington and reaching the Cincinnati semi-final and the US Open quarter-final. After falling outside of the top 100 in June, she ends the year as the world No. 12.
And Badosa believes her performance against Swiatek showed that she can still hang with the best, even if she still has a lot of work to do. "She maintained her level throughout the match and the clearest difference was on a physical level," the 27-year-old said of her opponent.
"In that respect, she is at a higher level, which is why she has been No. 1 in the world for three years in a row and has won so much. There is a big difference with the others and today I experienced it first hand.
"This match has made me see that the level is there, but I have been watching it for a long time and that you have to work hard physically to withstand that demand for the three hours that the match lasts.
"I will not deny that I am happy with the year, it has been a big change from the middle of the year to now. Coming back from an injury is not easy. Even though I lost today, I am proud of myself."