DUBAI, United Arab Emirates -- Tomas Berdych saved three match points before upsetting defending champion Roger Federer 3-6, 7-6 (8), 6-4 Friday to earn a spot in the final of the Dubai Championships against Novak Djokovic.

Top-ranked Djokovic rallied past fourth-seeded Juan Martin del Potro 6-3, 7-6 (4) in the other semifinal.

Berdych broke to go up 3-2 in the third set, only for Federer to save two match points before holding for 5-4. But the sixth-ranked Berdych finished it off when Federer hit a crosscourt forehand into the net.

"It feels really amazing," Berdych said. "It's really just about one single point that I was able to make better than him. For me, it was a celebration of tennis. I like to play him so much because of what he has achieved."

The second-ranked Federer hasn't reached a final in 2013 and seemed at a loss to explain how he failed to finish off Berdych.

"Pity to lose that one, but Tomas did well to hang in there," Federer said. "Obviously, I leave this match with a lot of regrets."

In the second-set tiebreaker, Berdych led 4-2 before saving two match points -- the second with a powerful serve. The Czech player then wasted a set point before Federer failed to convert his third match point. Berdych clinched the set with a blistering return.

Federer only converted 2 of 11 break points and his serve waivered in crucial moments, especially in the tiebreaker.

"You do all the right things for so long, and then at the end you've got to explain why you didn't hit two shots decent," he said. "So it's disappointing."

Djokovic prevailed in a match that seemed to turn after a time violation warning.

The Serb, bidding for his fourth Dubai title in five years, made the only break of the first set and won it when del Potro hit a return long. Del Potro took a 3-0 lead thanks to a much-improved service game only to unravel when he was warned for taking too long on his serve.

Serving at 3-1, 30-40, the Argentine was warned by the chair umpire for taking more than the allotted 25 seconds. It sparked a flurry of boos in the packed stadium and an angry del Potro hit a forehand wide to make it 3-2. Djokovic ran off three straight games and seemed in control. But with the Serb up 5-3 and serving for the match, del Potro broke a second time and made it 5-all.

Djokovic forced the tiebreaker and won it when del Potro hit another forehand long.

The victory extends the Serb's winning streak to 17 matches -- including his third Australian Open title -- dating back to last year. His last loss was Oct. 31 at the Paris Masters to Sam Querrey.

"I was very pleased with the performance overall and the way I handled myself in the tough moments," Djokovic said. "Mentally, I stayed tough and believed that I could go all the way and win in straight sets. I didn't really allow myself to be negative. I have been very, very positive and confident."

Del Potro said he lost his focus after the warning for the time violation.

"I lost my calm when I started to discuss with the umpire, and (Djokovic) come back in the second so quick," del Potro said. "He's the No. 1. When he feels the chance to improve his game, he always takes it. Tonight, he played better all the time."

Del Potro criticized the timing of the warning, considering it came just as he was ready to serve. His complaints followed that of Berdych, who said this week it was an unnecessary rule and a clock should be put on court to ensure the rule was consistently applied.

"We play very long rallies during the match and he called the warning just before I served, a break point down," del Potro said. "It's a very important point for the game, for the match. Maybe he doesn't know about that. ... If you call a warning or if you do something different, you can lose focus, and that's what happened with me."

Djokovic agreed it was an unfair call because del Potro had not been privately warned beforehand, which often is the custom.

"As a chair umpire, you need to follow the game," Djokovic said. "If it's a long point, you need to have that little amount of tolerance, I guess, and patience also for the player. It's unfortunate obviously, you know. I understand why he was frustrated."

The ATP modified the rule this year to make it easier for umpires to crack down on slow play. Slow play between points has been a long-running complaint among fans and some players.