In a back-and-forth tiebreaker, Berdych led 4-2 before needing to save 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 finally clinched the set with a blistering return.
Berdych then 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 Czech finished it off when Federer hit a crosscourt forehand into the net.
"It feels really amazing," Berdych told the crowd. "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 has still not 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."
Federer only converted two of 11 break points and also saw his serve let him down at 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."
Earlier, the top-ranked Djokovic stormed past fourth-seeded Juan Martin del Potro 6-3, 7-6 (4), in a match that was marked by a disputed time violation call that was a key turning point.
The top-ranked 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 then jumped out to 3-0 in the second courtesy of a much improved service game only to unravel when he was warned for taking too long on his serve.
Facing a break point at 3-1, the Argentine was given a warning by the chair umpire for taking more than the allotted 25 seconds. It sparked a flurry of boos in the packed stadium and prompted a furious Del Potro to argue with the umpire. He then hit a forehand wide to make it 3-2, lifting his racket as he was going to smash it. Djokovic ran off the next three games, but failed to serve out the match at 5-3.
However, the Serb clinched the tiebreaker 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 acknowledged that he lost his focus after the time violation warning.
"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, though, criticized the timing of the warning, considering it came just as he was about to make his serve. His complaints followed that of Berdych, who said this week it was an unnecessary rule and that a clock should be put on court to ensure the rule was applied consistently.
"We play very long rallies during the match and he called the warning just before I served, a break point down," he 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, since del Potro had not been verbally warned beforehand which often was 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.