Rafael Nadal has been denied a comeback victory in his first tournament since returning from injury after losing to the world number 73 at the VTR Open final in Chile.
Horacio Zeballos defied the odds to claim a 6-7 (2/7) 7-6 (8/6) 6-4 win over the former world number one and lift his first ATP Tour title.
Nadal had looked relatively untroubled en route to the final and was the overwhelming favourite to end a positive return to competitive tennis after seven months out with the title at Vina del Mar.
But Zeballos was clearly not overawed by facing the 11-time grand slam champion and produced a battling performance that showed why he had overcome three seeds on his way to the final.
"It's a dream for me," Zeballos said afterwards.
"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 not played a competitive match before this week since his shock second-round loss to Lukas Rosol at Wimbledon last year, missing out on the second half of last year and this year's Australian Open due to injury and illness.
But Zeballos, who failed to progress beyond the second round in any of the tour-level events he competed in last year, saved his best performance of the week for the final.
Nadal saved two break points on his opening service game and looked to be on course for victory after wrapping up the first set on a tie-break.
Yet even then, the Argentine refused to buckle and he duly levelled proceedings after another tight tiebreaker.
There had been no breaks of serve in the opening two sets, but Nadal changed that when he won the opening game before immediately relinquishing his advantage.
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.
"I've worked really hard because I really wanted to be at this level," Zeballos added.
"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 characteristically chose to take the positives from the defeat, despite missing out on the chance to collect his 37th clay-court title.
Yet the former world number one hopes he can go from strength to strength following a successful comeback in Vina del Mar.
"It was a great tournament for me," he 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.
"I just need to keep working, practicing 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."
Follow us @SprtNationalUAE