LONDON (AP) Stanislas Wawrinka rallied to beat David Ferrer 6-7 (3), 6-4, 6-1 Friday at the ATP World Tour Finals to maintain his hope of reaching the semifinals.

Wawrinka had 35 winners, including 12 aces, to clinch his second win at the elite, year-end tournament. He'll need top-ranked Rafael Nadal to beat Tomas Berdych later to advance to the final four.

Nadal, who clinched the season-ending No. 1 ranking this week, has already qualified from Group A after winning his first two matches without losing a set.

Defending champion Novak Djokovic has won Group B. The winner of Saturday's match between Juan Martin del Potro and Roger Federer will join him in the semifinals.