Roger Federer stepped up his grass game as the start of Wimbledon looms, holding off Australian Matthew Ebden 7-6 (7/2), 7-5 in their quarter-final at the ATP Halle tournament on Friday.
With his world number one ranking on the line, the Swiss is sparing no effort to make sure he lifts a tenth title at the event on Sunday.
He will next play US qualifier Denis Kudla who beat Yuichi Sugita 6-2, 7-5.
The victory was the 19th in a row on grass for the 36-year-old Federer, who last lost on his favourite surface in an opening match in Stuttgart a year ago, although the 20-time Grand Slam champion atoned last weekend, winning that tournament for the first time.
The other semi-final will pit Roberto Bautista Agut against Borna Coric.
Fourth seed Bautista Agut defeated Russian Karen Khachanov 6-3, 6-7 (3/7), 6-3 while Croatian Coric eliminated Italy's Andreas Seppi 7-5, 6-3.
Failure by Federer to win the grasscourt title would send rival Rafael Nadal back to the top spot going into Wimbledon which starts on July 2.
"I felt I had to push myself today," Federer said. "It didn't come as easy as it did in other matches.
"But you can't allow that to be frustrating. I can take away a lot of positives.
"Now that I'm in the semi-finals I can see the light at the end of the tunnel -- you either lose in the semis or have two more matches, max. That allows me to find extra energy."
"I'm happy I played well when I had to," Federer said. "I'm happy I got through somehow."
The first set on Friday was decided in a tiebreaker while the Swiss had to twice recover from a break down in the second to secure a tight victory in 88 minutes.
Federer set up match point with a flicked backhand pass and then sealed his semi-final place as Ebden returned long.
Ebden did not make it easy for Federer, staying with the Swiss into the first-set tiebreaker.
The Aussie double-faulted to hand over four set points but one was enough as Federer hit a backhand service return winner.
In the second set, Ebden broke Federer twice and served for the set at 5-4 only for the Swiss to break back for a second time.
After Federer held to love he then broke Ebden again to finish the match by winning four straight games.
"It's normal once you get broke on grass to get ready for a possible third set," Federer said. "That's the logical consequence of being broken."
"At the same time, you need to show a reaction, try to break back. I was able to do that today.
Kudla, ranked 109, had never been past a quarter-final on grass which he achieved at Queen's Club five years ago.
Kudla improved to 17-14 on grass over his career as he put out Sugita, the No. 52 who stunned third seed and Roland Garros finalist Dominic Thiem in the second round.
Kudla saved a set point at 5-2 down in the second set and has reached the final four without the loss of a set as he continues the best week of his career at age 25.
Kudla fired his sixth ace on match point to complete his victory in just under 90 minutes, as he broke his Japanese opponent four times.