(CNN) -- World No. 2 Rafael Nadal has crashed out of the ATP World Tour Finals after suffering his second group-stage defeat in London on Thursday.
Needing to beat Jo-Wilfried Tsonga to go through to Saturday's semifinals as Group B runner-up behind Roger Federer, the Spaniard went down 7-6 (7-2) 4-6 in pulsating clash with the sixth-ranked Frenchman.
Tsonga is next likely to face unbeaten Spaniard David Ferrer, who plays Tomas Berdych in his last Group A match on Friday.
Ferrer has already qualified, and most permutations will see him go through as group winner no matter the result of that match. Berdych will qualify ahead of world No. 1 Novak Djokovic if he wins in straight sets.
Djokovic can still make it if he wins in two sets against fellow Serbian Janko Tipsarevic -- who is standing in for the injured Andy Murray -- and Berdych loses a set.
Federer had already qualified as Group B winner before beating Mardy Fish 6-1 3-6 6-3 in Thursday's opening match, handing the eighth-ranked American a third successive defeat in his debut at the tournament.
Tsonga tested Federer in the tournament's opening match on Sunday before losing in three sets to the defending champion, who is seeking to win a record sixth title.
The 26-year-old brushed off Fish in straight sets on Tuesday before Federer thrashed Nadal 6-3 6-0 to leave second place up for grabs.
Tsonga, making his first finals appearance in three years, had a 2-6 record against Nadal but took full advantage of the 10-time grand slam champion's apparent end-of-season fatigue as his aggressive approach paid dividends.
The Spaniard looked like he might save the match as he bounced back with familiar fist-pumping power in the second set, but Tsonga's booming serve and acrobatic ability kept him out front in the decider.
He promptly celebrated with his trademark victory dance, having improved on his 2008 debut in Shanghai when he lost twice but beat Djokovic.
Earlier that year Tsonga defeated Nadal in the semifinals of the Australian Open, then lost to Djokovic in the title match.
Nadal ended his 2011 season with a 67-15 record, winning one grand slam but losing his top ranking to Djokovic as the 24-year-old triumphed in the other three.