ROTTERDAM, Netherlands — Roger Federer added another highlight to his age-defying career resurgence Friday, returning to the top of the world rankings for the first time in more than five years and becoming the oldest player to reach the top spot.

"What an amazing run its been and a journey it's been for me ... to clinch world No. 1," Federer said.

Beating leading Dutch player Robin Haase 4-6, 6-1, 6-1 in the quarterfinal at the ABN AMRO World Tournament means the 36-year-old Federer becomes the oldest player - male or female - to top the world rankings, surpassing Andre Agassi, who held the record at age 33.

"Getting to No. 1 and enjoying it right here at 36, almost 37 years old is an absolute dream come true," Federer said. "I can't believe it."

Federer will leapfrog 31-year-old Rafael Nadal to No. 1 when the rankings are updated on Monday.

Also a record will be the five-years-plus which have elapsed since Federer was last No. 1, and the 14 years since he first reached the top spot.

On Monday, he will extend his record of 302 weeks at No 1 since the rankings began in 1973. Pete Sampras is a distant second with 286 weeks at the top. Novak Djokovic is the closest currently active player, with 223 weeks at No. 1.

"Reaching No. 1 is one of, if not the ultimate achievement in our sport," Federer said.

"Sometimes at the beginning you get there just because you play so well. Later, you sometimes try to fight it back and you wrest it back from somebody else who deserved to be there, and when you're older you feel like you have to put maybe double the work in. So this one maybe means the most to me throughout my career."

Federer, the 2005 and 2012 ABN AMRO champion, plays either Andreas Seppi or Daniil Medvedev in the semifinals on Saturday.

Federer won the Australian Open in January for his 20th Grand Slam title and edged closer to the top of the rankings. He had not originally planned to play in Rotterdam but accepted a wild card when it became clear he might be able to take back the top spot.

Haase made clear he was going to make Federer fight, and broke him in the ninth game and fired an ace to take the set 6-4.

But Federer stepped up a gear and blew Haase away in the second set, reeling off 11 straight points to race to 3-0 in taking the set 6-1.

Federer then broke Haase twice early in the third for 3-0, and swept to the victory.

Earlier, Grigor Dimitrov beat Andrey Rublev 6-3, 6-4 to reach the semifinals, where he will meet 2017 finalist David Goffin, who progressed when his quarterfinal opponent Tomas Berdych pulled out sick.