Rafael Nadal came agonisingly close to winning an ATP title in Bastad but was downed 6-3, 6-2 by Nuno Borges in the final.
Injuries have ravaged the 22-time Grand Slam winner for well over a year but he is trying to build momentum ahead of the Olympics.
He entered the Swedish ATP 250 event to get minutes in his legs and he impressed en route to the final. But Nadal was unable to reach his best level as world No.51 Borges won the first title of his career.
Nadal struggled from the off and posted a 40% first serve percentage in the opening set.
The 38-year-old got off to the worse possible start on the red clay as he served a double fault to be broken and 2-0 down.
The Spaniard broke straight back by moving into the net after dominating a baseline rally and Borges fired a passing shot long down the line.
Nobody was able to hold serve in the early exchanges as Borges made it three consecutive breaks to lead 3-1.
Borges kicked on and wrapped up the first set 6-3 in 46 minutes.
The second set started much tighter until Borges broke to make it 3-2. The Portuguese star, 27, then flexed his muscle to storm to a 6-2 victory.
After the match, Borges said: “I don’t know what to say. I think I was wishing for this moment for a while.
“It is crazy tennis, it doesn’t happen when you expect it sometimes.
“I know we all wanted Rafa to win and a part of me wished that too but something even bigger inside of me really pushed through today. Through the emotions and all the ups and downs.
“It wasn’t about playing my best tennis today. It was just about coming through in the big moments and I couldn’t have played better. I don’t know what to say, I am very emotional.”