Federer lost the opening set of his second-round match to Italy's Simone Bolelli before calling the trainer to Rod Laver Arena for what initially appeared to be a blister on the little finger of his right hand.
The Swiss star looked decidedly uncomfortable and ushered away a nearby television cameraman – "Do you need to be so close?" – but recovered his composure to eventually secure a 3-6 6-3 6-2 6-2 victory.
"I'm very happy," the 17-time grand slam champion said in an on-court interview. "It was a great match. I thought Simone played really well in the first set, so I really had to fight until the middle of the third set and once I got the break I was able to relax a little bit, but it was tough and I'm really pleased to come through.
"I was already seeing myself explaining losing in the second round and I'm happy I don't have to do that interview."
Asked about the injury, second seed Federer added: "I don't know. It felt like a bee stung me. I never had this pain before – it was disturbing me. I knew taping it wasn't the right thing so I just wanted to speak to the trainer. Thankfully it wasn't as bad at the end."
Second seed Federer, chasing his fifth Australian Open title, will next play either Frenchman Jeremy Chardy or Italy's Andreas Seppi in the third round.
The Swiss star has always made the third round in 16 attempts in Melbourne and has reached the semi-final stage for the last 11 Australian Opens.
Meanwhile, Bulgaria's Grigor Dimitrov beat Lukas Lacko in four sets and now faces Marcos Baghdatis, who knocked out 20th seed David Goffin of Belgium.