Miami, USA, 27 March 2012 | AFP

Andy Roddick beat Roger Federer for only the third time in their 24 meetings on Monday, dominating with his serve to win 7-6(4) 1-6 6-4 in the third round at the Sony Ericsson Open.

Roddick broke serve 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.

“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 US Open, while Roddick was ranked 34th, the lowest he has been since 2001.

Roddick 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.”

Roddick hammered 12 aces and won 74 per cent of his first-serve points to outlast Federer in the two hour, one minute match.

“It was kind of a game of chess,” Roddick said.

“I stayed back on the returns, which is something I have not done with him often early on. He might have been a little bit surprised by it.”

World No.1 Novak Djokovic defeated No.27 seed Viktor Troicki 6-3 6-4 in an all-Serb third-round match.

Djokovic, who won Miami titles in 2007 and 2011, saved seven of eight break-point opportunities as he beat Troicki for the 11th consecutive time.

“Generally I feel that I have been playing well,” Djokovic said.

“I did have some ups and downs, especially in today’s match, but I’m confident that I can raise the level of my performance in every match.”

Djokovic finished with two aces, one double fault and won 73 per cent of his first-serve points in the 85-minute match.

Djokovic next plays 17th seed Richard Gasquet of France.

No.8 seed Mardy Fish assured he’ll remain the top-ranked American man by beating No.28 Kevin Anderson 6-4 6-3.