Federer rallied in the third set only to fall when he held serve but couldn't overcome the Italian in the match's second tiebreak, losing 6-4, 7-6 (5), 4-6, 7-6 (5).
"I just tried to enjoy to play on the center court again, so I just tried to do my best," Seppi, 30, said in a postmatch on-court interview with ESPN. "It was one of my best matches for sure, or else I couldn't win against Roger. It was fun to play in front of a full stadium."
Federer, a 17-time Grand Slam champion who has won the Australian Open four times, hadn't been beaten this early in Melbourne since 2000, the second year he played here. He had reached the semifinals or better at Melbourne Park every year since winning the championship for the first time in 2004.
Seppi said he wasn't sure about the match-winning point, a close down-the-line shot that just slipped around Federer.
"I didn't know if I could play a winner," said Seppi, who clinched the match on serve in the tiebreak.
It sealed Seppi's first win over Federer in 11 matches, in which Seppi had won only one set. The Italian had advanced beyond the second round only once in his nine previous trips to Melbourne Park.
Federer said Seppi had played him tough in the past.
"I knew on a quicker court when he gets more help with the serve it was going to be a bit more tricky," Federer, 33, said.
Federer was up 4-1 in the second-set tiebreaker before he allowed Seppi to win six of the next seven points and the set. He led the fourth-set tiebreaker 3-1 before a double fault helped the Italian to again overcome the deficit.
"I knew how important that second-set tiebreaker was -- clearly that hurt, losing that one," Federer said. "It just broke me to lose that second set -- the fourth set, too. The end wasn't pretty. It wasn't easy playing with that shadow, but it was the same for both of us."
Federer walked over to Seppi's side of the net to shake his hand after the match and clapped to the crowd before he left the arena with his head lowered. It was only the second time in his past 43 Grand Slam tournaments that the Swiss star failed to reach at least the fourth round.
Federer fell to 1-6 in his career at the Australian Open when falling behind two sets to none. His only win came in the 2009 round of 16 against Tomas Berdych, who earlier became the first men's player to advance to the fourth round when the No. 7 seed beat Viktor Troicki 6-4, 6-3, 6-4.
Federer was trying to rally from two sets down for the 10th time in his career, which he did most recently at last year's US Open against Gael Monfils.
Dimitrov also had a tough third-rounder against 2006 Australian Open finalist Marcos Baghdatis before winning 4-6, 6-3, 3-6, 6-3, 6-3.
Murray is attempting to become the first man to win the Australian Open after losing three times in the final. He lost to Novak Djokovic in 2013 and 2011 and Federer in 2010.
Berdych, who lost the 2010 Wimbledon final and reached the semifinals here last year, needed eight match points to clinch it, most of them in the penultimate game when Troicki held serve. He clinched it with an ace.
"It looks not very nice on the paper -- mostly, all of them on a big first serve," Berdych said. "It was a great save from him. I needed to wait one more game. ... When the first chance came up, I served well and took it."
Information from The Associated Press was used in this report.