( CNN ) -- World number one Rafael Nadal has avenged his two recent defeats to Roger Federer with a victory over his rival in a charity match in Madrid , Spain . Wednesday night 's clash was the second of two exhibitions aimed at raising money for the pair 's foundations , with Federer winning Tuesday 's contest in the Swiss city of Zurich . It was the third time in the last month that the world 's top-two male tennis players have met and Nadal 's first victory in that period , after Federer won in Switzerland and at the ATP World Tour Finals in London , England . Twenty-four hours earlier the two stars joined forces to raise funds for Roger Federer 's foundation , and the `` Match for Africa '' raised $ 2.6 million for the 29-year-old 's charity . Is Nadal 's battered body his biggest threat ? The 23-year-old Nadal thanked his opponent for his participation in the match and was pleased the duo could use their status to raise money for a good cause . `` I say thank you very much to Roger for coming here to Madrid and supporting my foundation today , '' the nine-time grand slam winner told the ATP Tour 's official website after winning the match 7-6 ( 7-3 ) 4-6 6-1 . Federer and Nadal net $ 2.6 million in Zurich charity clash . `` Both of us are very happy that we can finally have this event and raise a lot of money for these kids . I know that with what we 're going to raise ... it 's not going to be decisive but it will be a help . It 's going to be important to improve this world a little bit . '' The contest , named the `` Joining Forces For the Benefit Of Children '' match , attracted an all-star crowd to the Caja Magica , including Spain 's Queen Sofia . Also in attendance was former world number one Carlos Moya , who announced his retirement from tennis in November after a prolonged struggle with a foot problem .
Rafael Nadal beats Swiss Roger Taylor in Madrid in the second of two exhibition matches . The world number 1 claimed a 7 - 6 4 - 6 6 - 1 victory over the Swiss No . 2 . The matches have been used to raise funds for the duo 's charitable foundations .