The world's top ranked tennis players played in front of a sold-out Hallenstadion indoor arena in Zurich, Switzerland. This was the first time they have played each other in Federer's home country.
For the record, Federer won, 4-6, 6-3, 6-3. But this match, unlike the many times these two competitors have battled for higher stakes, had a different tone.
It was a fund-raiser for Federer's foundation, which backs educational work with children in Africa. It currently supports projects in Ethiopia, Malawi, Tanzania, Zimbabwe and his mother's native South Africa.
"This is a special match for me, which I will remember forever," Federer said. "I'm just so proud and so happy that we all made it work."
The rivals will be in Madrid on Wednesday for a return match in the top-ranked Nadal's home country in support of his foundation.
"It was an unforgettable experience. I'm very happy to be part of this event," Nadal said.
The good-natured match was the showpiece of a telethon-like event broadcast live by Swiss television. Swiss sports stars, including Olympic champion cyclist Fabian Cancellara and Alpine skier Didier Cuche, helped auction prizes they donated.
Also attending was American ski star Lindsey Vonn. The Olympic downhill champion is a fan and friend of Federer's. She arrived in Zurich hours after competing in a World Cup slalom in Courchevel, France.
In tournament play, Nadal leads Federer 14-8. Federer won their most recent meeting, a 6-3, 3-6, 6-1 decision in the title match of last month's ATP World Tour Finals in London.
Based on reporting by the Associated Press.