MIAMI (AFP) - World number two Roger Federer overcame American Andy Roddick in three sets Wednesday to set up a semi-final clash with Novak Djokovic at the ATP Masters 1000 hardcourt tournament here. The second-seeded Swiss, still in search of his first title of 2009, defeated Roddick 6-3, 4-6, 6-4, avenging a quarter-final loss to the American here last year. In the semi-finals 13-time Grand Slam champion Federer will face third-seeded Serbian Djokovic, who beat 10th-seeded Frenchman Jo-Wilfried Tsonga 6-3, 6-4. Federer, who won back-to-back titles here in 2005 and 2006, closed out the match with a service break, earning a match point with a backhand winner that clipped the net cord and found the corner. Another backhand found Roddick helpess at the net. Federer said he enjoyed playing the hometown favorite, but he wouldn't have minded putting it away sooner. "I thought that I should have had it under control in the second set," Federer said. "Kind of lost that and was under quite a bit of pressure in the third set. So I'm happy I got through it. "Got maybe a touch lucky at that deuce passing shot. Bu, I hit it well and came up with a great shot and match point. So I was really happy. It was a good win for me tonight." Roddick thrilled the crowd of 14,000 by taking the second set, but he was disappointed that he couldn't hold off Federer in the third. "It's easier if I would have just played terrible the whole time," said Roddick, who failed to convert two game points in the final game. "I at least gave it a go there in the third, and didn't really catch a break there," he said. Djokovic, who had lost his last four encounters with Tsonga, reversed that trend despite receiving treatment for apparent heat-related symptoms in the second set. Djokovic broke Tsonga to take a 4-2 lead in the second, saved two break points in the eighth game and was under pressure again as he served for the match at 5-4 but closed out the victory in just under two hours. Djokovic, who said he had been battling a stomach ailment on Tuesday, said that the after-effects, the heat and the pressure of the match combined to affect him. But he still displayed precise, powerful groundstrokes that had Tsonga on the defensive from the start. "I have to be very happy with today's performance, because I have been struggling to find a way to win against him in the last four encounters," he said. "I just knew that I needed to stick in and try to wait for my chances and be aggressive. "Today I think I tried to be closer to the line, more in control, and just put the pressure on him. So I think that's what I did." The other men's quarter-finals on Thursday pit world number one Rafael Nadal against sixth-seeded Argentinian Juan Martin del Potro and fourth-seede Briton Andy Murray against Spain's eighth seed Fernando Verdasco. Nadal, the Australian Open champion, is gunning for his second straight prestigious Masters 1000 title in as many starts after his triumph in Indian Wells, California. Serena survives Chinese scare American Serena Williams survived a scare from China's Li Na to advance to the semi-finals of the ATP and WTA tournament where she awaits a tussle against her sister. The top-seeded Serena Williams lost the first five games but rallied to beat Li 4-6, 7-6 (7/1), 6-2 in the quarter-finals on Wednesday.She will face sister Venus Williams who earned a semi-final berth with a 6-1, 6-4 win over Czech Iveta Benesova. Ask to explain what went wrong early against unseeded Li, Serena said she couldn't get going, "I don't know. I just had a really slow, retarded start." Serena Williams was on the verge of defeat, but Li failed to convert all six of her break-point chances in the pivotal second set. "She didn't give me any chance," Li said. "I had six or seven break points but I didn't hold for one point."In the final set she played much better. In the first set she didn't try 100 percent." Williams is seeking her sixth Miami title, which would break the record she shares with Steffi Graf.The other semi-final on Thursday will be between eighth-seeded Svetlana Kuznetsova and No. 11 Victoria Azarenka. Serena said she would give herself a failing grade for the first set on Wednesday. "If I was in school and I was like a professor and I had to give myself a grade, I would give myself like an eight percent out of 100." Asked if she would remember this match and try to learn from her mistakes, Serena said, "I'm thinking about shredding the DVD too." She said she usually talks more out loud when she is on her game and that didn't happen against Li. "I wasn't as upbeat and spirited as I normally am. I think maybe one or two 'come ons' during the whole match which is not really normal for me." Serena said she expects to play better against three-time champ Venus in the semi-finals. "I am always going to be up for V," Serena said. "Because she's playing really well and always playing me super tough. "It is like I automatically have to be on a different level because she's already playing a different level."Her balls are harder and her serve is way bigger. It is like I have to be there. And it is super fun to hit those serves that are like 120. It is frustrating but at the same time fun." Li was the third Chinese player, Serena had defeated in a row. Serena also beat Zheng Jie 7-5, 5-7, 6-3 and Peng Shuai 7-5, 6-2. "I was feeling like she play Fed Cup, three in a row Chinese players," Li said. "Good for the Chinese. They have more experience to play No. 1 in the world."