Rafael Nadal was denied the Chile Open title on his comeback from injury as Argentina's Horacio Zeballos came from a set down to beat him in the final.
Zeballos, ranked 73rd in the world, won his first ATP Tour title with a shock 6-7 (2-7) 7-6 (8-6) 6-4 victory at the clay-court event in Vina del Mar.
Former world number one Nadal, 26, was playing his first tournament after eight months out with knee trouble.
"It's true I wanted to win the final but it wasn't possible," he said.
Zeballos did not progress beyond the second round in any of the tour-level events he competed in last year, but had already beaten three seeds en route to his match against Nadal.
"It's a dream for me," the 27-year-old told the ATP Tour's official website.
"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."
Before this week, Nadal had not played a competitive match since suffering a shock second-round defeat by Lukas Rosol at Wimbledon last year.
Having suffered with a knee injury, the world number five pulled out of January's Australian Open with a stomach virus.
The Spaniard saved two break points on his opening service game and looked to be on course for victory after wrapping up the first set in a tie-break.
But Zeballos refused to buckle and took the second set after another tight tie-break.
There had been no breaks of serve up to that point, but Nadal changed that by winning the opening game of the third set - only to relinquish his advantage immediately.
At 5-4 ahead, Zeballos made his move and charged into a 0-40 lead on Nadal's serve before converting his first match point and sealing victory after two hours and 46 minutes.
Nadal, though, was positive in defeat, despite missing out on his 37th clay-court title.
"It was a great tournament for me," he said. "I just need to keep working, practising with hope, motivation and the right attitude to have better sensations every week. I hope it's the beginning of a lot of good things for me."
There was more disappointment for the Spaniard after he and Argentina's Juan Monaco were later beaten in the doubles final, losing 6-2 6-4 to Italians Paolo Lorenzi and Potito Starace.