Roger Federer will return to world number one after reaching the Mercedes Cup final in Stuttgart, Germany.
The 20-time Grand Slam winner recovered from losing the opening set to beat Australia's Nick Kyrgios 6-7 (2-7) 6-2 7-6 (7-5).
The Swiss, 36, will now overtake Spanish rival Rafael Nadal when the new rankings are released on Monday.
He will face Milos Raonic in Sunday's final after the Canadian beat defending champion Lucas Pouille 6-4 7-6 (7-3).
Victory against the world number 35 will give him a 98th career title.
It is the third time Federer has reached the top of the rankings this season.
Find out how to get into tennis in our special guide.
He has already achieved 309 weeks at the top of the rankings since February 2004.
Meanwhile, at the Libema Open in s'Hertogenbosch, Britain's Dominic Inglot claimed his third doubles title of the year.
He and Croatia's FrankoSkugor beat South Africa's Raven Klaasen and New Zealand's Michael Venus 7-6 (7-3) 7-5.
Source: Radio Television Brunei