Federer was leading 4-1 in the third set tiebreaker before Nadal rallied.
After the Spaniard double-faulted while ahead 6-5, the players traded match points. Nadal then hit three of the final four winners from the clay side before a sellout crowd of about 7,000.
The grass caused some tricky bounces, especially as the match progressed. But both players showed little difficulty in switching surfaces, as they changed shoes at changeovers.
Changeovers were extended to two minutes instead of the usual 90 seconds to give players a chance to change their footwear for each surface.