Roger Federer seen in action at the ATP Istanbul Open earlier in the week.

AFP/Istanbul

Top seed Roger Federer on Saturday survived a stern test from world number 63 Diego Schwartzman of Argentina to reach the final of the Istanbul Open after a tense three-set encounter.

Federer, 33, looking to win his 85th career title, looked rattled all afternoon as he failed to find rhythm on his first serve and even received a rare code violation.

Losing the first set, he eventually prevailed 2-6, 6-2, 7-5, after an almost two-hour struggle on the red clay court.

"Diego was not missing at all," Federer said. "He deserves credit."

"It was a fun match, I think we both played very well at the end and there was a great atmosphere," he added.

Showing no sign of nerves in front of his illustrious opponent, Schwartzman, 22, came out fighting in the first set with his double-handed backhand particularly potent.

In a sign of the pressure, the usually mild-mannered Federer received a code violation warning from umpire Mohamed Lahyani for whacking the ball away in anger when he failed to convert a break point.

Mixing his game beautifully, Schwartzman more than rivalled Federer's play with cute drop shots and stunning whipped topspin winners.

After breaking the frail Federer serve twice, he took the first set with ease when the out-of-sorts Swiss world number two tamely netted a return into the net.

Schwartzman came out in the second set with similar aggression but after squandering one break point in the fourth game Federer took his second chance in what proved a turning point.

Turning on the power and with Schwartzman starting to make unforced errors, Federer raced ahead and took the second set with a service break to love.

With a tough struggle shaping up in the third set, Federer saved two break points in the fifth game, yelling "come on!" and saving his serve with an ace.

But Schwartzman stepped up a gear once more, matching Federer shot for shot in a thrilling finale.

Serving to stay in the match at 4-5, Schwartzman saved one match point with another stunning backhand winner.

But Federer then made no mistake as he attacked the Schwartzman serve at 6-5, taking his first break point chance to close out the match.

In Sunday's final, he will face the winner of the other semi-final between second seed Grigor Dimitrov of Bulgaria and Pablo Cuevas of Uruguay.

Related Story