World number one Roger Federer struggled past Czech qualifier Ivo Minar 6-7, 6-3, 7-6 when he began the defence of his Dubai Open title in Dubai on Wednesday.
The Swiss took almost two hours to scrape past a first-round opponent who has won just five matches in his career.
There were comfortable wins in the second round, however, for fourth seed Andre Agassi and fifth-seeded Spaniard Tommy Robredo.
American Agassi took just under an hour to beat Feliciano Lopez of Spain 6-1, 6-3 while Robredo put paid to Tomas Berdych of the Czech Republic 6-2, 6-4.
In a late game, Germany's Nicolas Kiefer came back from a poor start against South Korea's Lee Hyung-Taik to win 2-6, 6-1, 6-3.
Czech Minar, in his match against the game's leading player, held a point for a 4-1 lead in the final set.
Serving and returning well and hustling confidently at the net, Minar did not give Federer a chance to settle.
"It does you good to win matches like this," said Federer, who next faces former world number one Juan Carlos Ferrero.
"It was close and he played well to keep me under pressure, and I definitely didn't have my best day.
"That's got something to do with not being able to make the adjustment as quick as I would have liked [from playing indoors in Rotterdam], and him playing well, putting me under pressure and taking a lot of chances."
Minar, 20, had demonstrated his potential by reaching the Sydney final last month before losing to Lleyton Hewitt.
Games in the first set went with serve, with only one going to deuce, on Minar's serve. The Czech clinched the tiebreak 7-5 with a forehand drive volley.
It took Federer 53 minutes to earn his first break point and the top seed, who won the Rotterdam title on Sunday, broke to lead the second set 3-2.
Another break at 5-3 gave Federer that set but he failed to carry his momentum, dropping his serve to love with a double-fault in the opening game of the final set.
Federer failed to convert two break points in the next game before being forced to save a break point at 3-1.
Minar played a weak service game that allowed Federer to level at 3-3 and a fine crosscourt backhand return gave the Swiss a second break to lead 5-3.
Even then, Minar refused to give up the battle, breaking as Federer served for victory. Minar went down fighting 7-5 in the tiebreak.
Federer conceded losing had crossed his mind.
"Break point for a double break in the third, that was a crucial point," he said. "When I was broken at the beginning of the third, I thought this could really be a tough one.
"The way I was feeling and playing, I wasn't that confident because I didn't have the rhythm and it was tough to get into good rallies.
"But it was very close today and I'm happy I'm through."
Agassi was always in control against the left-handed Lopez, sweeping to a 4-0 lead in the opening set and winning most of the longer rallies.
Although Lopez offered more resistance in the second set and held a break point at 4-3, he made a backhand error and was broken to love in the next game before Agassi served out to seal the win.
"I felt it could have turned into a difficult match," said Agassi. "There's no question that if you let Feliciano play on his terms, which is to control it with his forehand, he becomes quite effective.
"I really had to execute my shots and make sure that I stayed in control of the point but didn't take too many chances. I felt very comfortable from the beginning."