Nadal, who equaled Bjorn Borg's record of six French Open titles and earned his 10th major with the victory, dropped to his knees and covered his face after Federer sent a forehand long on match point.
"To win this final against one of the best players in the world and in history is something which is really fantastic for me," said Nadal, who will keep his No. 1 ranking. "It's one of my most beautiful dreams."
The top-ranked Nadal improved his record at Roland Garros to 45-1, and to 17-8 against Federer. In Grand Slam finals, Nadal is 6-2 against his main rival.
"As it often happens, he is the best on clay," Federer said. "He proved it once again."
It was the first time in more than two years that Nadal and Federer met in a Grand Slam final. They have played in 13 major finals, seven more than any other pair of men in tennis history.
Nadal was playing to Federer's backhand on Court Philippe Chatrier, but even the 16-time Grand Slam champion's forehand was off. He committed 56 unforced errors in the match, while Nadal had only 27.
Nadal is the second youngest man behind Borg to reach 10 major titles. The Spaniard also is about six months younger than Federer was when he won his 10th.
Federer is 14-1 is Grand Slam finals against opponents other than Nadal. Federer lost to Nadal once at Wimbledon and once at the Australian Open. His two wins over Nadal both came at Wimbledon.