FRANKFURT, NOV. 14 -- Top-ranked Stefan Edberg became the first semifinalist in the ATP Tour World Championships tonight when he survived Andre Agassi, 7-6 (7-4), 4-6, 7-6 (7-5), in a 2-hour 36-minute match that ended past midnight.

Earlier, No. 2 Boris Becker resumed his challenge for the top spot, rallying past Andres Gomez, 4-6, 6-3, 6-3. Becker, in his first match since tearing a muscle in his left thigh 10 days ago, struggled early. But he regained his form in the second set and finished with 11 aces.

Pete Sampras kept alive his chances of making the semifinals by crushing Emilio Sanchez, 6-2, 6-4.

This round-robin, season-ending tournament pits the eight top-ranked men, split into two groups. Two players from each group advance to the semifinals of the $2 million event, formerly known as the Masters and played in New York.

Edberg is 2-0 in Group A, with Agassi and Sampras 1-1 and Sanchez 0-2. In Group B with Becker and Gomez are Ivan Lendl and Thomas Muster, who were idle today. Lendl is 1-0, having beaten Muster on Tuesday.

Becker still has a chance to overtake Edberg for the No. 1 spot. He must win the tournament while Edberg must lose in the semifinals.

Agassi saved nine set points in the opening set, four in the tiebreaker, in which Edberg grabbed a 6-0 lead. Agassi, ranked fourth, closed to 6-4 before Edberg won it.

Returning ferociously, Agassi broke in the fifth game of the second set and went on to tie the match.

They each broke once in the third set -- Agassi in the first game, Edberg in the sixth -- to force a deciding tiebreaker. Agassi raced to a 4-2 edge, but that's when Edberg returned a huge serve to win a crucial point, rallying for a 7-5 win.

"I had a big serve, and he barely got it back, but I skidded and hit the ball long," Agassi said of the key point.

Slow-starting Becker, with 9,000 fans cheering him on, finally broke in the seventh game of the second set, which he went on to win on a disputed call, tying the match.

In the third set, the three-time Wimbledon champion regained his rhythm and broke for a decisive 3-1 lead. Becker never was headed.

No. 5 Sampras, who has been bothered by shin splints, displayed the powerful serve-and-volley game that won him the U.S. Open.

"I played really good tennis. I knew I had to win to stay in contention," Sampras said. "If I feel healthy and if I play like I did today, I feel I can win this tournament. I have to prove that I can play with the big boys and I have to maintain my ranking."