Federer dominated Murray in the final two sets, finally controlling play from his serve and also getting his forehand on target.
Federer, who has two wins from two matches in Group A and is favored to reach the semifinals at the season-ending tournament, still has to play Juan Martin del Potro in the round-robin stage. Del Potro beat Federer in the U.S. Open final.
Earlier, Del Potro held on to beat Fernando Verdasco 6-4, 3-6, 7-6 (1), giving him a chance to reach the semifinals at the O2 Arena.
Federer also dropped the first set in a win over Verdasco on Sunday.
Because of Federer's win, he cannot be overtaken by second-ranked Rafael Nadal, who lost to Robin Soderling on Monday in his first Group B match.
Pete Sampras and Jimmy Connors are the only other players to finish the year as the top-ranked player at least five times since the rankings started in 1973. Sampras, whose record of 14 Grand Slam titles Federer broke this year at Wimbledon, has the most with six.
Federer began the night by breaking Murray's serve, but it was more because of the Briton's errors than Federer's stellar play.
The lead didn't last, however, because Murray broke right back, and then started to play the kind of tennis that earned him six wins over Federer in their previous nine meetings.
Murray broke again for a 4-2 lead, and saved a pair of break points in the next game before eventually winning the first set.
In the second, Federer won his first three service games at love, and he broke Murray to take a 4-2 lead. Along with his improving serve, Federer's forehand was also starting to get back to form. In the second set alone, Federer managed 10 of his 16 forehand winners -- he had only two in the first set.
In the early match, Del Potro wasted two match points in the third set and then was broken while serving for the win.
"I served much better than the other match," said Del Potro, who lost to Murray in his opening Group A match. "I was very focused in the important moments, especially in the tiebreak, and I take my opportunities."
The fifth-ranked Argentine most likely will have to beat four-time champion Federer on Thursday to reach the semifinals.
Verdasco, with two losses, will face Murray in his next match.
In Group B, Novak Djokovic and Soderling won their opening matches and will play each other today. Nadal will face Nikolay Davydenko.