The former top-ranked Swiss was emotional as he thanked his hometown fans after winning for the fifth time in six years at the event where he once worked as a ballboy.
"It's always the greatest for me to win the title here. See you next year," he said on court in Swiss-German.
Federer had a complete game on display to dominate the 32nd-ranked Japanese, who stunned top-ranked Novak Djokovic in the semifinals.
"He was too good for me today," said the 21-year-old Nishikori. "I tried to do my best but he wouldn't let me."
Federer's 68th career title was just his second this season after he won the season-opening event in Doha, Qatar. He had not reached a title match since losing the French Open final to Rafael Nadal in June.
Now ranked No. 4 at age 30, Federer was playing his first event while ranked outside the top three since he won his first Wimbledon title in 2003.
Nishikori started strong on his own serve but Federer broke after reeling off three straight winners. Federer dropped just one point on his own serve in the first set and fired flat ground strokes to all corners of the court. He repeatedly pressured Nishikori's serve and took the set on a double fault.
Nishikori fended off break point chances to hold serve early in the second, then showed his speed and defensive strength by outlasting Federer in a long rally. The reprieve was brief and Federer broke again to lead 4-2.
He was serving for the match when Nishikori earned his first break-point chance, which Federer saved with a powerful serve.
Federer took his first match point with an overhead smash at the net as Nishikori scurried to field shots deep beyond the baseline.
Nishikori will rise to a career-best ATP ranking Monday -- perhaps as high as No. 25, which would mark the highest ever by a Japanese men's player.
The Basel lineup originally included five top 10 players, with Federer and Djokovic returning after six-week breaks after the U.S. Open and Davis Cup matches.
"It has been a long time since I felt so good physically," Federer said.
Federer improved as the week progressed but won without playing anyone ranked higher than No. 15 American Andy Roddick in the quarterfinals.
An injury-hit week saw Djokovic hampered by right shoulder pains against Nishikori, while Britain's Andy Murray withdrew one hour before his first-round match.
Mardy Fish of the U.S. and Serbian Janko Tipsarevic retired in their opening matches having completed just seven games combined, and seventh-ranked Tomas Berdych of the Czech Republic was eliminated by Nishikori, a wild-card entry.
Copyright 2011 by The Associated Press