The defending champion and Dutchman Sjeng Schalken were the only two seeds to survive the day's play.
Second seed Guillermo Coria and fourth seed David Nalbandian both lost their first round ties, joining Rainer Schuettler, Mark Philippoussis and Tim Henman, who all went out on Monday.
The one remaining seeded player, seventh seed Paradorn Srichaphan plays Dominik Hrbaty on Wednesday.
Federer's serve was his only weakness against Russian Safin but it was able to get him out of trouble when he needed it.
It came to his rescue at 4-4 in the first set, when the Swiss faced two break points that would have left Safin serving for the set.
Four strong serves allowed Federer to hold, and he went on to dominate the tiebreak.
"I thought I was putting myself in trouble with my serving," said Federer.
"I was serving much better in Australia but the conditions were heavy and it was very difficult to hit a winner."
With Safin feeling fresher than he had during their Australian Open meeting, the two were more evenly matched and there were several furiously contested rallies.
Safin, a wildcard entrant, thought that he had competed well against the man who beat him 7-6, 6-4, 6-2 for the Australian Open title last month.
"I fought much better today (than in Australia) and was a just little bit unlucky in the tiebreaks," said 30th-ranked Safin.
"I had chances but didn't take them, and whatever chances he had he took. But I felt really good and felt like I could win today. It's not like I'm struggling with my confidence."
Federer will next meet Spain's Tommy Robredo, who defeated Swede Jonas Bjorkman 6-4, 6-4.
Eighth seed Schalken survived to reach the second round with an untroubled 6-3, 6-1 win over Sargis Sargsian of Armenia.
But second seed Coria lost 4-6 6-3 6-4 to Russia's Mikhail Youzhny, and fourth seed Nalbandian fell 6-3, 6-4 to Jarkko Nieminen of Finland.
Both Argentine Coria and Youzhny struggled to find their rhythm in the first two sets but produced several dramatic rallies in the third.
Youzhny moved better, and he struck several fine backhand winners to make him a worthy winner.