Rafael Nadal won his first European clay title of the season in unfortunate circumstances at the Mutua Madrid Open when Kei Nishikori retired through injury.
Having trailed by a set and a break, Nadal won seven straight games to lead 2-6 6-4 3-0 when Nishikori called it a day.
The Japanese player, who will break into the top 10 for the first time on Monday, struggled with a back spasm in an epic win over David Ferrer on Saturday and the problem returned at just the wrong moment.
Nishikori was playing in his first Masters series final and for a set and a half completely out-played an out-of-sorts Nadal.
Nishikori's aggressive approach and superb hitting had the clay-court king in all sorts of trouble and Nadal will know there remain very real questions about his form despite his victory.
Nadal had looked back to something like his best after quarter-final losses in Monte Carlo and Barcelona with four straight-sets win, and began the final with six successive points.
But Nishikori saved a break point and then exploited Nadal's horrible lack of rhythm by forging ahead 5-1.
Nadal saved a set point but Nishikori quickly closed it out and then broke serve again at the start of the second set.
Nadal had three chances to break in the next game, but missed them all, to the bemusement of himself and the Madrid crowd.
But Nishikori called the trainer to have his back massaged at 4-3 and it became clear in the next game that his movement was becoming compromised.
He saved two break points but not a third and, although he received further treatment, the writing was on the wall.
Earlier, Maria Sharapova recovered from an awful start to defeat Simona Halep and win the women's title.
It took Sharapova five games to get on the board and she lost the first set in less than half an hour, but the eighth seed turned things around early in the second set and went on to win 1-6 6-2 6-3.
The Russian has developed a formidable record on clay, a surface she used to hate, and seven of her most recent nine titles have now come on the dirt.
It certainly did not look like it would be a day to remember for Sharapova as Halep, the most improved player on the WTA Tour over the last year, raced into a 4-0 lead.
Halep was ranked 64th at the same time last year, but has since wong seven titles and climbed to fifth in the rankings.
She looked totally at home in her first final at a WTA Premier Mandatory tournament, but Sharapova can always be relied upon to fight to the last and she struck early in the second set.
The Russian, who has not lost to anyone other than Serena Williams on clay in almost three years, broke serve for the first time for 2-1 and went on to level the match.
Sharapova carried her momentum into the decider and opened up a 4-1 lead.
Halep won two games in a row to put the pressure on, but Sharapova pulled away again to clinch victory after an hour and 57 minutes.
It extended her winning run on clay to 11 matches after the former French Open champion also won the title in Stuttgart two weeks ago.
Speaking on court, the 27-year-old said: "Last year I lost in the finals and I really wanted to go one extra step this year, and it's just been such a fantastic week.
"Simona and I had played a couple of times before, but she's really on a different level now. I don't know how I pulled it off. "