Serena Williams ensured she will regain the world number one ranking next week after she beat Petra Kvitova to reach the Qatar Open semi-finals.
The American, 31, knew that reaching the last four in Doha would take her past Victoria Azarenka in the rankings, and she saw off Kvitova 3-6 6-3 7-5.
Williams last held the top spot in October 2010, and she now becomes the oldest woman to reach number one.
Chris Evert held the top ranking in 1985 just before turning 31.
"I'm so sensitive nowadays," said a tearful Williams after her victory.
"I'm always crying, but I never thought I would be here again. I've been through so much and I just never thought I'd be here, so thank you Jehovah for giving me another chance."
The 15-time Grand Slam champion endured horrendous misfortune after winning Wimbledon in 2010, cutting her feet on broken glass and requiring two operations on her right foot before suffering blood clots in her lungs.
"There were often times that I never thought I'd play again," she said. "Then I thought I'd never be able to win tournaments or Grand Slams.
"Number one was so far off. I mean, it was always a dream, but I was number one when tragedy struck, and it was just an awful thing to happen. So I'm happy that I'm back."
Williams was not at her best against Kvitova, the 2011 Wimbledon champion, but showed all her fighting qualities to recover from 4-1 down in the final set.
"I just hung in there and she was playing so good," she said.
"Every time I looked around she was hitting a winner and I thought if I could just stay in there. I could hear the crowd cheering for me, and I don't get that all the time, so that was nice."
Williams will face Maria Sharapova in the semi-finals on Saturday after the Russian beat Sam Stosur 6-2 6-4.
Sharapova began the week with an outside chance of reclaiming the number one spot she last held briefly last year, and said: "Is it great to have the opportunity to come back to that position?
"I mean, we'd be lying if we weren't. We're excited about having the chance. The ranking is always one of those things where it also depends on the other players' success and the amount of points and the tournaments that they play.
"That's out of my control, so that's the reason why, to me, maybe it's not as important as winning the match point of a Grand Slam."
Azarenka saw off Italian sixth seed Sara Errani 6-2 6-2 and will next play fourth seed Agnieszka Radwanska, who beat 10th seed Caroline Wozniacki 6-2 7-5.