"It was difficult, knowing he was the last guy to beat me here," Federer said. "I remember I was very sad after that match."
Ancic was an 18-year-old qualifier making his Grand Slam debut when he defeated Federer in the first round in 2002. Federer has since won the past three Wimbledon championships and 46 consecutive grass-court matches, and he needs two more victories for his eighth major title.
"I thought I played a terrific match," Federer said. "If I keep up this type of play, it'll be pretty good."
Only two rain delays — the first since the opening day of the tournament — slowed Federer's progress. He has yet to lose a set through five rounds, and his opponent Friday will be the winner of the quarterfinal between No. 14-seeded Radek Stepanek and unseeded Jonas Bjorkman.
In the women's semifinals Thursday, 2004 champion Maria Sharapova will play No. 1 Amelie Mauresmo, and No. 2 Kim Clijsters will face No. 3 Justine Henin-Hardenne in the 20th career match between the Belgian rivals.
Sharapova's quarterfinal victory Tuesday drew a visit from a streaker, and before the seventh game of Federer's match, two fully clothed men came onto the court carrying rackets and balls. One of them hit a shot before security guards approached, and the men departed as a smiling Federer watched.
Then his latest grass-court gem resumed.
Federer's shots consistently landed inches from a line, and he countered Ancic's serve-and-volley tactics by being aggressive himself. He came to the net behind one return while Ancic also moved forward, the result being a rare point-blank exchange of volleys that Federer won.
Ancic held his own in baseline rallies, winning 18- and 21-shot exchanges in the first set. But Federer coped well with the 6-foot-5 Ancic's big serve, hitting some returns nearly as hard, with one forehand clocked at 104 mph.
"I thought sometimes that I did some unbelievable shots," Ancic said. "I did exactly what I had to, and I was getting passed or (he was) getting some winners from nowhere. He played unbelievable.
"He's just Roger. What can you say?"
Federer had 35 winners and 17 unforced errors, and he survived one shaky moment. Serving at 4-3 in the first set, he committed three uncharacteristically sloppy errors, including a double-fault that left him facing a break point for only the seventh time in the tournament.
He escaped and held with a service winner, and in the opening game of the second set, he literally brought Ancic to his knees. The Croat lunged in vain at the net to intercept a passing shot. Two points later, Federer passed Ancic again to break for 1-0.
Federer won 30 of 34 service points during one stretch, including 14 in a row. He did lose serve for the second time in the tournament, but the break came only after he took a 3-0 lead in the final set.
He erased another break point with a sharply angled forehand winner and held for 5-3, then closed the victory with his seventh ace.
"I definitely had a period where it was so good, it was just incredible," Federer said. "You get the feeling that you're absolutely in control."