Dominic Thiem saved two match points as he came from behind to end Roger Federer's participation in his first clay tournament in three years. The Austrian prevailed 3-6, 7-6, 6-4 in a thrilling quarter-final at the Madrid Open on Friday. Federer had started strongly, breaking Thiem in the second game of the match. That proved to be the only break of the set as Federer clinched it on the second set point after 36 minutes. Thiem, who had come into the tournament on the back of winning in Barcelona last month, looked to hit back quickly but Federer saved two break points in his opening service game of the second set. Thiem was now showing the form that has made him one of the major contenders for the French Open and he earned three more break points in the sixth game. But Federer saved them all to keep the set on serve as the 37 year old showed all his experience and it went to a tie-break, which proved to be an epic. Federer spurned two match points and Thiem only clinched the set on his sixth set point as he won the breaker 13-11 to force a decider. Thiem took that momentum on into the deciding set and finally broke Federer in the third game. The 2009 French Open champion tried to hit back as he earned two break points in the following game, but Thiem held on. However Federer's persistence was rewarded in the eighth game as he got the set back on serve. But this proved to be a false dawn as Thiem broke again in the next game and he served it out to clinch an epic victory. Thiem now meets world No 1 Djokovic on Saturday for a place in the final. Djokovic had been given a walkover after his scheduled quarter-final opponent Marin Cilic withdrew after suffering from food poisoning. In the women's competition, French Open champion Simona Halep is through to the final after fending off a tough challenge from Belinda Bencic. She overcame the Dubai Duty Free Tennis Championships winner 6-2, 6-7, 6-0 and she will face either Sloane Stephens or Kiki Bertens in Saturday's final.