Undeterred by an on-court intruder, Federer beat surprise finalist Soderling 6-1, 7-6 (1), 6-4 to complete a career Grand Slam and win his 14th major title, matching Sampras' record.
On his fourth try at Roland Garros, Federer became the sixth man to win all four Grand Slam championships.
"Now the question is: Am I the greatest of all time?" Federer said. "We don't know, but I definitely have many things going for me because I've finally won all four Grand Slams, and I'm particularly happy reaching Pete's 14."
When the stylish Swiss hit a service winner on championship point, he fell on his knees to the clay that had vexed him for so long, screamed and briefly buried his face in his hands. He was teary by the time he met Soderling at the net, and fans gave Federer a standing ovation as he raised his arms in triumph.
"It's maybe my greatest victory, or certainly the one that removes the most pressure off my shoulders," Federer said. "I think that now and until the end of my career, I can really play with my mind at peace and no longer hear that I've never won Roland Garros."
Tears ran down Federer's cheeks as the Swiss national anthem played.
"Roger, really, congrats to you," Soderling said. "You really gave me a lesson in how to play tennis today. And to me you're the greatest player in history. So you really deserved to win this title."
"I'm obviously happy for Roger," Sampras told The Associated Press in a telephone interview from Los Angeles, where he lives. "Now that he has won in Paris, I think it just more solidifies his place in history as the greatest player that played the game, in my opinion."
The supportive crowd in Paris included Andre Agassi, the most recent man to complete a career Grand Slam when he won at Roland Garros 10 years ago. Agassi presented Federer with the trophy.
"You're the last man to win all four Grand Slams," Federer said. "Now I can relate to what it really feels like. ... It feels good to be for once on the podium as the winner. It's a magical moment."
Playing in cool, windy weather and occasional rain, Federer raced to a quick lead, sweeping the first four games. Soderling appeared nervous at the start of his first Grand Slam final, and Federer kept him scrambling with penetrating groundstrokes to both corners and an occasional drop shot.
Federer's progress to the title was briefly delayed in the second set. The match was between points when a spectator waving a flag climbed through the photographer's pit and onto Federer's side of the court.
"That gave me a fright," Federer said. "He looked at me, and I was not sure what he wanted. ... It was a touch scary."
Federer backed away toward the backstop, but the fan caught up with him and tried to put a hat on Federer's head. Security personnel seemed slow to react before chasing the man to the other side of the court, and he was tackled, then carried out.
There was silence from the stunned crowd, then a chant of "Ro-ger! Ro-ger!" when the episode ended. Federer adjusted his headband, Soderling gave him a thumbs-up sign and play resumed.
Soderling's strokes steadied, and he pushed the second set to 6-all. But Federer played a brilliant tiebreaker, hitting aces on all four of his service points, and Soderling could only smile ruefully.
Federer broke again to start the third set and kept that lead the rest of the way. He never lost serve, and despite the difficult conditions, he had more winners than unforced errors - 41 to 24.
"It's always tough to play Roger," Soderling said. "He really played well today. I had a few small chances in the second set, but overall he played too well for me today."
Federer owed Soderling a thank-you for easing his path by upsetting four-time defending champion Rafael Nadal in the fourth round last Sunday. Nadal beat Federer at Roland Garros the past four years, including three consecutive times in the final.
"I kind of was relieved, because he was going to be the hardest one to beat," Federer said.
For Federer, a matchup against the 23rd-seeded Soderling was much more inviting. The Swede had never previously been beyond the third round at a Grand Slam tournament, and he fell to 0-10 against Federer.
"Yesterday, me and my coach were joking," Soderling told Federer during the trophy ceremony. "You've beaten me nine times in a row, and we were joking nobody can beat me 10 times in a row. But we were wrong."
Despite Nadal's surprising departure, Federer's path to the title wasn't easy. He rallied from a two-set deficit in the fourth round to beat Tommy Haas, and survived another five-setter against Juan Martin del Potro in the semifinals.
"I've had a tough draw," Federer said. "Of course, it's not Nadal on the other side of the net, but I beat him a couple of weeks ago on clay (in Madrid), so I really feel like I really deserve it."
Federer won his 14th Grand Slam championship at age 27. Sampras, who never reached a French Open final, was 31 when he won his last major title. Federer will try for No. 15 beginning in two weeks at Wimbledon, which he has won five times.
He has also won the U.S. Open the past five years, and he has three Australian Open titles.
Besides Federer and Agassi, the other men to win all four Grand Slams tournaments were Fred Perry, Don Budge, Rod Laver and Roy Emerson.