The Swiss star, seeking a fourth Australian Open title, dropped the opening set before coming back to win 4-6, 6-2, 7-6 (7-2) 6-0 against the Russian.
“I knew it was going to be tough,” said the 15-time Grand Slam champion. “We played five sets in New York two years ago. I thought I was playing well even in the first set and thought I would hang in there.
“It was a tough first round and I’m really, really relieved I’m through. It was a tough third set, I definitely got very lucky to get out of that one. That’s the way it goes sometimes, all in all I’m very happy with my performance.”
Federer was joined in round two by No3 seed Novak Djokovic and No6 Nikolay Davydenko, who enjoyed routine victories, although last year’s French Open finalist, Robin Soderling, became the first big-name casualty – the No8 seed going down 5-7, 2-6, 6-4, 6-4, 6-2 to Marcel Granollers.
“I started terrible and finished terrible,” the Swede surmised.
Djokovic, the 2008 champion, recovered from an early break to beat Spain’s Daniel Gimeno-Traver 7-5, 6-3, 6-3 and showed no signs of the heat exhaustion which ended his campaign last year when he retired from his quarter-final with Andy Roddick.
“I was struggling in the first set, that’s no secret,” the Serbian admitted. “In the end I picked it up, and I was really happy overall with how I handled things.
“To get a little bit more time on the court today was actually a positive.”
Davydenko, meanwhile, cruised past German qualifier Dieter Kindlmann 6-1, 6-0, 6-3.
There was no such problem for women’s No1 Serena Williams, who made a solid start to her title defence with a 6-2, 6-1 victory over Poland’s Urszula Radwanska.
Sister Venus, seeded No6, was equally comfortable in her 6-2, 6-2 victory against Lucie Safarova of the Czech Republic, while former world No1, Ana Ivanovic, also progressed after she beat Shenay Perry 6-2, 6-3.