Federer and his fellow Swiss player Stan Wawrinka have played each other 26 times, with Federer leading 23–3. Federer leads 7–1 in Grand Slam tournaments, 17–0 on hard courts, 1–0 on grass courts and 5–3 on clay courts. The pair are 1–1 in finals. Their first meeting in a final came at 2014 Monte-Carlo Rolex Masters where Wawrinka defeated Federer in three sets to win his first Masters title before Federer avenged his loss at the 2017 BNP Paribas Open by beating him in the final. While the rivalry is one-sided in Federer's favour, the two have contested some close matches. Wawrinka defeated Federer in straight sets during the 2015 French Open quarterfinals en route to winning his first French Open title, although Federer then won a straight-sets victory in the 2015 US Open semifinals. 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, the 2014 ATP Finals semifinal, which Federer won in three sets after saving four match points, and the 2017 Australian Open semifinal, which Federer won in five sets. Despite their on-court rivalry, they are 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.