The 36-year-old Swiss overcame an early setback to beat Robin Haase of the Netherlands 4-6, 6-1, 6-1 and will replace old rival Rafael Nadal at the top of the rankings.
Federer surpasses Andre Agassi, who held the top spot aged 33 years and 131 days in 2003, as the oldest man to claim the world number one spot.
It is Federer's first time back at the summit since October 2012 having first claimed the top position in February 2004.
"Reaching number one is the ultimate achievement in tennis. When you're older you have to work double the amount, you have to wrestle it back from someone who's worked hard to get there. It's a dream come true," an emotional Federer said on court immediately after the match.
Federer nears historic world number one ranking
"It's been an amazing journey and to clinch it here, where I got my first wildcard in 1998, means so much."
Agassi was amongst the first to congratulate Federer.
"36 years 195 days... @rogerfederer continues to raise the bar in our sport. Congratulations on yet another remarkable achievement!!," tweeted the American.
Federer had talked on Thursday of his desire to retake the world number one spot but doubted it would ever happen after he underwent knee surgery last year.
"I've struggled to try and get there. I had to win a lot of matches last year," said Federer, who was as low as 17 in the world in January 2017 before he returned to form with the Australian Open title.
"I never imagined this after my (February 2016) knee surgery. Number one is a tough place to get to. The most important thing is to be healthy, I would have had great regrets if I had not come here this week."
On Friday, Federer dropped his first set of the week against the aggressive Haase but regained control to ease to victory as the Dutchman struggled with a back injury.
The Swiss triumphed to the cheers of the fans in 79 minutes, ending with six aces.
Haase, the 30-year-old world number 42, finished on a disappointing note with his second double-fault on match point.
Second seed Grigor Dimitrov edged towards a possible first Rotterdam final as he dispatched young Russian Andrey Rublev 6-3, 6-4 to reach the semi-finals.
Federer wins 6th Australian Open for 20th Slam title
The Bulgarian duplicated his 2013 semi at the Ahoy Stadium with a win in an hour and a quarter, sending down a dozen aces and saving both break points he faced at the hands of his 20-year-old opponent.
Dimitrov edged ahead in the series, 2-1 as he put out the tournament debutant ranked 34th and holding one ATP title from last summer on clay in Umag.
Sixth seed Tomas Berdych withdrew prior to his quarter-final, with the Czech's absence putting fourth seed David Goffin into the semi-finals.
Berdych, the 2014 champion, has reportedly been ill for several days and was unable to compete.
COMMENTS (1)
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ