Rafael Nadal was denied a fairytale return to the game by Horacio Zeballos who stunned him in the Vina del Mar final in Chile.
Zeballos, the world No 73 and playing in just his second ATP Tour final, rallied to beat the former world No 1 6-7 (2-7) 7-6 (8-6) 6-4.
The Argentine became just the third player - along with Novak Djokovic and Roger Federer - to beat Nadal in a clay court final.
Nadal was playing his first tournament in seven months because of injury, and he was delighted with how it went, despite losing Sunday's showpiece.
"It was a great tournament for me," Nadal said. "If we take everything, it was positive. It's true I wanted to win the final but it wasn't possible. He made things better than me and I didn't play my best match."
"It was a week when we didn't know how the body would respond, the knee. At least we have seen we can compete up to a certain level. It's true I have had good days and bad days that impact on my play."
Zeballos said: "It's a dream for me. To be able to play a final against Nadal was already good enough for me. It's a moment that will stay in my memory for the rest of my life."
Nadal had lost just 14 games on his way to the final, but Zeballos played the match of his life.
Neither player managed a break of serve in the first two sets, Nadal ripping through the first tie-break, and Zeballos - after blowing two set points at 6-4 in the breaker - taking the second.
And he took the title by breaking Nadal to love in the final game.
"I've worked really hard because I really wanted to be at this level," Zeballos said. "For some months, I've been playing at a high level and I think I'm at the best moment of my career. I'm very strong physically and psychologically."
Nadal returned to the court later, teaming up with Argentina's Juan Monaco where they lost in the doubles final to Italians Paolo Lorenzi and Potito Starace 6-2 6-4.
He plans to compete in clay court events in Brazil and Mexico before playing ATP Masters hard court events at Indian Wells and Miami and then heading to Europe for clay events in Monte Carlo, Barcelona and Rome ahead of the French Open.