Federer is a previous winner of the Qatar Open
World number two Roger Federer produced a stunning trick shot as he advanced to round two of the Qatar Open with a 7-6 (7-3) 6-3 win over Thomas Schoorel.
Federer had to save three set points when trailing the 21-year-old Dutch qualifier 5-4 in the opening set.
Having won the set and with a 5-2 lead in the second, Federer was facing the baseline when he flicked a shot through his legs for a winner into the corner.
World number one and top seed Rafael Nadal coasted past Karol Beck 6-3 6-0.
Nadal, seeking his first win in Doha, led 3-0 in the first set then broke Beck all three times in the next but insisted: "It was not an easy match. But I started well and kept playing well. I think I gave a good performance."
The 24-year-old Spaniard, who won three Grand Slams in 2010, added: "I try to do better every day and be consistent."
Meanwhile Federer, winner of this tournament in 2005 and 2006, reeled off five points in a row to level the score at 5-5 and then took advantage of three long returns by Schoorel to take the set on a tie-break.
It's one of the best shots again of my career, one I'm going to look back and smile, of course
The 29-year-old, winner of 16 Grand Slam titles, broke serve for the first time in the match in the fourth game of the second set before thrilling the crowd with his trademark trick shot and swiftly completing victory.
Federer has previously unveiled the shot between the legs, also known as a "Tweener", at the last two US Opens, at last year's Shanghai Masters and at the 2007 Dubai Open.
"It's one of the best shots again of my career, one I'm going to look back and smile, of course," he said of the latest example.
"In the first set, he played really well. This player has quality. I got confidence when I saved those set points. Then I picked up my game."
Next up for the Swiss maestro is compatriot Marco Chiudinelli, who beat Reda El Amrani 3-6 7-6 (7-3) 6-3.
In other matches, fifth seed Ernests Gulbis of Latvia beat Romanian Victor Hanescu 6-3 7-6 (7-6) and eighth-seeded Philipp Kohlschreiber of Germany defeated Andreas Seppi of Italy 6-2 6-4.