Roger Federer is not playing his best tennis at the Gerry Weber Open this week, but still managed to make his way to the semi-finals with victory over Matthew Ebden on Friday.

The Swiss ace saved two match points in his third round clash against Benoit Paire and admitted after that he was close to being ousted from the tournament he has previously won nine times.

Despite winning his match against Ebden in straight sets, it was not a cruise for Federer. Both the sets were tightly contested before he secured his passage with a 7-6, 7-5 win in one hour and 28 minutes. He will next face unseeded American Denis Kudla for a place in the final of the Gerry Weber Open in Halle, Germany.

“It was tricky,” Federer said after his win over Ebden, as quoted on Tennis World USA. “I think Ebden played a good match and I’m happy I got through somehow.”

Roger Federer Roger Federer made the semi-finals at the Halle Open on Friday. In this picture, Federer of Switzerland celebrates after defeating Australia's Matthew Ebden in their match at the ATP tennis tournament in Halle, western Germany, on June 22, 2018. Photo: CARMEN JASPERSEN/AFP/Getty Images

“I can take a lot a lot of positives out of today’s match for the semis tomorrow. I think once you reach the semis, for me anyhow, I start seeing the light at the end of the tunnel , that [signals] the tournament is coming to an end.”

Federer revealed a trade secret when he suggested he gets extra energy once he makes the semi-final at a tournament as he knows he will play a maximum of two matches if results go his way.

The 20-time Grand Slam winner won the Mercedes Cup in Stuttgart the week before this tournament – it was his first event in three months. Despite that, the Swiss tennis legend admitted he is not very tired going into the semi-final clash against Kudla.

“Either you lose in the semis or you have then two more matches maximum. So, I think that allows me to find some extra energy now. I’m not incredibly tired,” Federer added.

The Swiss maestro is favorite to pick up his second grass court title in 2018 and fourth overall title, having won the Australian Open and the Rotterdam Open at the start of the year. Federer’s win in Stuttgart saw him return to the top of the world rankings – he is now ahead of Rafael Nadal by 150-points.

The 36-year-old, however, has to defend his titles in Halle and Wimbledon to remain at the top of the ATP men’s singles ranking. A slip up in any of the tournaments will see Nadal return to the top of the standings.

The Spaniard has just 180-points to defend on grass and is expected to play at Wimbledon despite pulling out of the Fever-Tree Championships at the Queen’s Club this week. If Nadal makes it past the quarter-final, he will have a chance to retake number one even if Federer defends his title at SW19. The two players have already switched the top spot five times between them since last July.