World number one Rafael Nadal was given a sterner test than expected as world number 162 Peter Gojowczyk took him to three sets before giving way 4-6 6-2 6-3 in the Qatar Open semi-final.
Nadal lost 12 of the first 13 points before losing the opener, but came back strongly in the second.
German Gojowczyk kept battling however and broke Nadal's serve early in the decider before he was overwhelmed.
Nadal will play France's Gael Monfils in Saturday's final.
Monfils beat Germany's Florian Mayer, who knocked out Britain's Andy Murray in the second round, in the day's second semi-final 6-3 6-2.
Although the world number 31 has lost eight of his 10 meetings with Nadal, both Monfils's victories came in previous editions of the Doha tournament.
Nadal admitted that he may be vulnerable to another defeat after undergoing fresh treatment on his long-standing knee complaint during the brief break between seasons.
"I need to play much better to have a chance tomorrow," he said.
"If I don't improve my level of tennis, my level of rhythm, and play more inside the baseline my chances of winning will not be big.
"I never win a title in the first week of the season, and tomorrow I have another opportunity."
The Australian Open, the opening Grand Slam of the season, begins in Melbourne on 13 January.