Novak Djokovic battled a stomach complaint late on to beat Jo-Wilfried Tsonga 6-3 6-4 and book his place in the semi-finals of the Sony Ericsson Open in Miami.
The Serbian looked on course to end a four-match losing run against Tsonga, when he raced through the opening set before breaking in the fifth game of the second to go 3-2 ahead.
But two games later the world number three's problems became evident as he called a medical time out to help deal with stomach cramps.
After the break in play Djokovic was clearly still hampered as he missed 14 first serves and while it gave Tsonga a sniff of victory, the Serbian gritted his teeth to claim the match with a forehand winner down the line.
Djokovic will now face Roger Federer in the semi-final after the former world number one won his late quarter-final against Andy Roddick 6-3 4-6 6-4.
Federer, who lost to Roddick at this stage in the event last season but who has a good track record against the American, is hoping to win his first title of 2009 at the event in Miami.
He had little trouble in picking up the first set after breaking Roddick's serve in the fifth game to take a 3-2 lead then doing it again to win the set.
But Roddick fought back in the second to win just his ninth set against Federer, before both players tested each other in the third.
Neither player could break the other's serve until the final game of the set when, with Roddick serving, Federer fought back from 40-15 to take the game to deuce, then got a lucky clip off the top of the net to go to match point.
The men's quarter-finals conclude on Thursday when Rafael Nadal faces sixth-seeded Argentinian Juan Martin del Potro, and fourth-seeded Andy Murray battles eighth-seeded Spaniard Fernando Verdasco.