Wawrinka then held serve to level the final set at six games all to reach the tiebreaker.
Federer struck a crosscourt backhand passing shot winner to lead 1-0 before Wawrinka netted a crosscourt backhand slice to trail 0-2.
Federer then struck a topsin crosscourt backhand winner passing shot to lead 3-2 before hitting a down the line forehand passing shot winner right on the sideline to lead 4-2.
Wawrinka hit an ace down the tee to pull to 4-3 before netting a crosscourt backhand return to trail 3-5.
However Wawrinka pulled even at 5 points all after Federer hit a backhand long followed by a forehand long.
Federer then netted a down the line backhand return to trail 5-6 and face match point number four.
Wawrinka would fail to convert his final match point; however, as he struck a down the middle forehand return long to trail 6-7 with Federer holding match point.
Federer, who had been aggressive throughout the day on key points was aggressive again
on match point as he struck a forehand drop volley winner to end the match 4-6, 7-5, 7-6(8-6).
However the Swiss, who finished 2014 with a 73-12 match record, five ATP Tour titles and $9,343,988 in prize money, was forced to pull out of the London final against the world number one Novak Djokovic of Serbia one day later with a back injury.
“Unfortunately, I’m not match fit to play the match tonight,” Federer said in his on court speech to the court. “Clearly I wish it wasn't so. I tried all year to be ready for the ATP World Tour Finals, and I didn't want it to end this way. I tried everything I could last night, also today- painkillers, treatment, rest, so forth, warm-up, until the very end- but I just can't compete at this level with Novak. It would be too risky at my age to do this right now and I hope you understand.”
“I wanted to come out personally and excuse myself. It’s been a great week for me. I played some great tennis and I love coming to The O2 and to London, and there’s been so many great memories for me here. Congrats of course to Novak, who’s played an amazing season, and an amazing tournament here as well. I hope we can play some more great matches, hopefully next year.
“Thanks to all you guys for making it special to come out and play tennis all around the world. I know you guys travel, as well, and spend a lot of money on tickets and so forth. We really, really appreciate it- me in particular. It keeps me going, it makes me tick, especially at this age. Hopefully, I can come back next year and get another chance to compete for the title here. So thank you very much and I'll see you soon. I appreciate it.”
In his best grand slam result of the year, Federer reached the Wimbledon final before losing to Djokovic 6-7(7-9), 6-4, 7-6(7-4), 5-7, 6-4.