(CNN) -- World No. 1 Roger Federer overcame an early scare to reach the semifinals of the Estoril Open in Portugal on Friday, but second-ranked Novak Djokovic's defense of his Serbia Open title was ended by health problems.
Federer was broken in the first game by French veteran Arnaud Clement but bounced back to win 7-6 (9-7) 6-2 as he continues his build-up to the French Open, which he won last year.
Djokovic's own hopes on the red clay of Roland Garros seem less positive after he was forced to retire having lost the first set of his quarterfinal 6-4 against young compatriot Filip Krajinovic at his home event in Belgrade.
The top seed has been struggling all week with allergy problems and fatigue, according to his personal Web site.
Federer is on track to win back the title he claimed on his only other appearance at Estoril in 2008, but admitted he was not yet at his best ahead of Saturday's semifinal clash with defending champion Albert Montanes.
The Swiss star, who is closing on Pete Sampras's record of 286 weeks at No. 1, needed to save a set-point at 6-5 in the tie-break.
"I didn't play beautiful tennis. I had to play safe, which isn't something I'm used to doing. I have always struggled against him and today you could see that," Federer told the ATP Tour Web site.
Fourth-seeded Spaniard Montanes moved into the last four by beating Uruguayan eight seed Pablo Cuevas 6-4 6-3.
He has lost all three previous encounters with Federer, two of them on clay.
In the other semifinal, fifth seed Guillermo Garcia-Lopez takes on world No. 133 Frederico Gil, having progressed when fellow Spaniard Alberto Martini retired due to illness.
Gil went through after beating compatriot Rui Machado 4-6 7-6 (7-1) 6-3 in the first all-Portuguese quarterfinal at an ATP World Tour tournament.
The 18-year-old Krajinovic, a wildcard entry, will play American third seed Sam Querrey for a place in the Belgrade final.
Querrey defeated Russian Igor Andreev 6-3 2-6 6-4 to reach his fourth semifinal this season.
The winner of that match will play either big-serving American second seed John Isner or Swiss No. 4 Stanislas Wawrinka.
In Munich, top seed Marin Cilic reached the semifinals of the BMW Open by beating sixth-seeded Spaniard Nicolas Almagro 6-4 6-7 (2-7) 6-2.
The Croatian world No. 11 will next play fifth seed Marcos Baghdatis of Cyprus, who beat 2007 champion Philipp Kohlschreiber 6-3 6-4.
Second seed Mikhail Youzhny, the runner-up for the past two years, also moved into the semis with a 6-1 6-3 win over Czech Jan Hajek.
The Russian will next face world No. 45 Philipp Petzschner, who upset defending champion and third seed Tomas Berdych 1-6 6-3 6-4.