Roddick did not break Federer until deep into the third set
Andy Roddick upset world number one Roger Federer with a 7-6 4-6 6-3 win in the Sony Ericsson Open quarter-finals.
It was only Roddick's second win in 17 career meetings against the Swiss star, his last coming in Montreal in 2003.
"He hasn't missed a ball against me for about six years," said the American. "I figured the law of statistics had to work for me eventually."
Federer, who has had a poor season so far by his standards, admitted: "I think I did well to hang in there."
Despite not forcing a break point until the eighth game of the third set, it was enough for Roddick, who broke to love when Federer dumped a forehand into the net.
The big hitter wrapped up victory on his third match point with a sizzling service winner.
Roddick admitted: "I was saying to myself 'Please hit a big serve and let this be done. I have an opportunity for this to be over in two-and-a-half-seconds'."
He now faces Nikolay Davydenko after the Russian thrashed Serb Janko Tipsarevic 6-2 6-1.
Serena Williams remained on track for her fifth Miami title with a 3-6 7-5 6-3 semi-final win over Svetlana Kuznetsova.
Williams showed all her fighting qualities to win in three sets
Kuznetsova won four straight games as she took command of the first set and was within sight of victory at 5-5 in the second.
But, despite requiring treatment for a back injury, Williams recovered to reach her sixth final at the event.
Defending champion Williams made 43 unforced errors in just under three hours of action against Kuznetsova, with the intense heat a factor.
"I felt I made a lot of errors compared to the quarter-final (against Justine Henin)," said Williams.
"Svetlana played an entirely different game than I expected her to play, but once I got used to it I was okay."
The American started shakily and appeared to hurt her back chasing a backhand in the fourth game, prompting two visits from the trainer for court-side massages.
"It got better once the trainer came out," said Williams. "The first time she (came on the court), she did something that worked.
"It got stuck out of nowhere, but once she fixed it, it got better."
Kuznetsova looked the more likely to progress deep into the second set but she faltered when trailing 5-6, dumping an easy volley into the net at break point.
The final set opened with four straight breaks of serve but the key moment came when Williams broke for a 5-3 lead.
Kuznetsova said: "I think if I played the right points at the right time I could've won it in two sets.
"When I was on top of the game I played too safe. When she was on top, I was playing better.
"It's uncomfortable this situation because I thought I was playing well."
Williams faces world number three Jelena Jankovic in Saturday's final after the Serbian overpowered Russia's Vera Zvonareva 6-1 6-4.