The match started just how Federer would have hoped as the Swiss ace broke his opponent's serve in the first game of the contest, but a poor service game of his own allowed Berdych to level the scores.
The opener went to a tie-breaker and Berdych dominated the first seed throughout to win the first set decider 7-1.
Federer was clearly troubled following the disappointment in the tie-breaker and Berdych took advantage by breaking the 31-year-old's serve at the beginning of the second set.
Berdych continued to serve superbly and the Czech's ace tally continued to rise before breaking Federer's serve once again to build a 5-2 lead.
The 26-year-old had the opportunity to serve for the set but Federer refused to give up and he immediately broke back.
However, normal service was quickly resumed in the match with Berdych delivering two aces in his next service game to take the second set.
At the start of the third set, Federer was once again sloppy during a couple of important rallies to hand Berdych another break of serve.
The sixth seed buckled under pressure to allow Federer to break back and a second break of serve for the world number one gave him the chance to serve for the third set, an opportunity he seized comfortably.
In a tense fourth set, a solitary break of serve was enough for Berdych to complete a famous victory and set up a semi-final with Andy Murray.