Roger Federer has recorded a three-set victory over David Ferrer to progress through to the Rogers Cup semi-finals in Toronto.
The number two seed, who was celebrating his 33rd birthday on Friday, looked on course for a routine win after taking the first set against an opponent whom he had beaten on each of the 14 occasions that they had previously faced each other.
Ferrer broke Federer twice in the second to take the match to a decider, but the Wimbledon runner-up regained his touch behind his first serve to run out a 6-3 4-6 6-3 winner.
Federer will play Feliciano Lopez in the last four after the big-serving Spaniard saved nine break points in the final set against Milos Raonic to record a 6-4 6-7 6-3 triumph.