KEY BISCAYNE, Fla. (AP) -- Techno music rocked the stadium during a changeover, then faded, the din replaced by the crowd's cheers as Andy Roddick took his position at the baseline, one game from a win over nemesis Roger Federer.
Roddick held the balls, and that was the edge he needed. He served out the match to win 7-6 (4), 1-6, 6-4 Monday night in the third round at the Sony Ericsson Open.
With that, the fans roared again, saluting only the third victory for Roddick in 24 meetings with Federer.
"There is no script in sports, you know. I think that's what makes it the best entertainment in the world," Roddick said. "Nights like tonight are why you play the matches. You don't know what's going to happen."
On paper, it looked like a mismatch between former No. 1s, each a two-time champion in the event. The third-ranked Federer began the night 40-2 since the U.S. Open, while Roddick's ranking had slipped to 34th, his lowest point since 2001.
But Roddick's serve kept him in the match, and then won it. He broke only once but held every service game in the first and last sets.
After falling behind 15-30 in the final game, he closed out the victory with an ace and two service winners, all at more than 130 mph. That ended Federer's streak of 77 consecutive wins against players outside the top 20.
"I feel like I lost against a former No. 1, not that I lost against a guy ranked 30 in the world," Federer said. "I'm happy to see Andy play really well. He's a great champion, and enjoy him while you have him. It was a great night for him and America's tennis."
Also dominating with the serve was Serena Williams, who matched a career high with 20 aces to beat Samantha Stosur 7-5, 6-3 to reach the quarterfinals.
"My serve was hot," Williams said. "I was like, 'That's pretty cool.'"
She avenged a loss to Stosur when they last met in the U.S. Open final in September.
"That wasn't in my mind," Williams said. "I just thought, 'This is a new game.'"
Top-ranked Victoria Azarenka lost 10 of the first 11 games, then rallied to remain unbeaten this year by beating No. 16-seeded Dominika Cibulkova 1-6, 7-6 (7), 7-5. Azarenka was two points from defeat five times, but swept the last three games and extended her winning streak to 26 matches, all in 2012.
"I'm proud of the way I fought," she said. "With my game I don't think I'm really pleased, but it doesn't really matter. The most important is that I found the resources."
Also reaching the quarterfinals was No. 2 Maria Sharapova, who overcame 11 double-faults to beat Ekaterina Makarova 6-4, 7-6 (3). Sharapova won despite committing 52 unforced errors and losing her serve four times.
No. 1 Novak Djokovic advanced to the fourth round by beating No. 27-seeded Viktor Troicki 6-3, 6-4. Djokovic is bidding for his third Key Biscayne title and second in a row.
No. 8-seeded Mardy Fish assured he'll remain the top-ranked American man by beating No. 28 Kevin Anderson 6-4, 6-3.
Federer lost only seven points on his serve in the opening set, but when he failed to put away an overhead trailing 4-3 in the tiebreaker, the match swung Roddick's way.
Federer squandered another chance with a 1-0 lead in the third set, failing to convert four break points in the next game. After Roddick escaped for 1-all, he earned his lone break in the next game, his grunts filling the stadium as he cracked four forehand winners.
"One of the best return games I ever played," Roddick said.
"It was a big turn of events there in five minutes," Federer said. "That's how tennis goes sometimes."
Roddick served out the final four games without facing a break point. When he let loose a 134-mph serve to win the final point, he raised his arms and waved his racket at the heavens.
He was thinking of his agent, Miamian Ken Meyerson, who died in October.
"I felt like I was a crazy person because I think I was having full dialogues with him the last 30 minutes of the match," Roddick said. "I was just letting him know that I heard him."
Roddick had reason to look for assistance from above: He had lost 52 of 64 sets against Federer entering the match. Federer had won six meetings in a row since Roddick beat him in the Key Biscayne quarterfinals in 2008.