Wawrinka and his compatriot Roger Federer have played each other 26 times with Wawrinka trailing . Federer leads 7–1 in Grand Slam tournaments, 17–0 on hard courts, 1–0 on grass courts and 4–3 on clay courts. While the rivalry is one-sided in Federer's favour, the two of them have contested some close matches such as the 2014 Monte Carlo Rolex Masters final in which Wawrinka came from behind a set to defeat Federer in three sets to win his first Masters 1000 title. Wawrinka also defeated Federer in straight sets during the 2015 French Open quarterfinals en route to winning his first ever French Open title although Federer then reversed it with a straight sets victory in the 2015 US Open semifinals. Federer defeated Wawrinka in five sets in the 2017 Australian Open semifinals en route to his 18th major title. Other close matches include the 2012 Shanghai Masters and the 2013 Indian Wells Masters, both of which Federer won in three sets, the 2014 Wimbledon quarterfinal which Federer won in four sets and the 2014 ATP World Tour Finals in which Federer won in three sets after saving four match points. The duo's most recent encounter took place at 2019 French Open with Federer prevailing in four sets. Despite their on-court rivalry, they are close friends off court and they have played doubles together on numerous occasions, most notably when they won the doubles Olympic Gold at the 2008 Beijing Olympics and when winning the 2014 Davis Cup.