It was only the Australian Open champion's second win over his close friend in 15 career meetings and his first title at the Masters level.
His last win over Federer came at the same venue in 2009.
Wawrinka also held on to his world number three ranking as a result of his success in two hours, 13 minutes.
Federer would have taken the third spot with a victory at one of the three Masters events he has not won.
It was the first all-Swiss final on the ATP since 2000, when the teenaged Federer lost to Marc Rosset in Marseille.
Wawrinka, who fired 33 winners on Sunday, lost his previous two Masters finals — in Rome in 2008 to Novak Djokovic and last year in Madrid to Rafael Nadal.
The title was Wawrinka's third of the year after trophies at Chennai and Melbourne in January.