It was a masterful tennis con job as Agassi took a page from coach Brad Gilbert's book, ''Winning Ugly,'' and backed it up with his own brand of corner-to-corner groundstrokes Sunday to carve out a 4-6, 7-5, 7-5, 6-1 upset.

''Today was a huge, huge obstacle in my way,'' said Agassi, a first-round loser a year ago who is trying to become the first American in 61 years to complete a career Grand Slam. ''I felt good about not just winning, but how I won. I like the way I played.''

Venus Williams didn't much like the way she played in blowing three match points and falling 2-6, 7-6 (9-7), 6-3 to Austrian qualifier and No. 125-ranked Barbara Schwartz. The fourth-round exit was the quickest in the last seven Grand Slam tournaments for the No. 5 Williams.

Jennifer Capriati saw her inspired run end with a 6-2, 6-3 loss to No. 2-seeded Lindsay Davenport.

''I've come a long way just in the last month,'' said Capriati, who won her first title in six years before the French. ''I never would have thought in a million years that I'd be at this point. I definitely exceeded my expectations.''

Agassi, who next faces Filippini, was the victim of a one-sided pummeling as he trailed Moya by a set and two breaks at 1-4 in the second. Agassi suddenly turned the match around with off-speed shots, junk lobs, lunging retrievals and a go-for-broke offense that Moya couldn't handle.

''Both breaks in the fourth set came on me just barely getting my racket on the ball and creating an error (by Moya),'' Agassi said.

Moya seemed mesmerized by watching Agassi stand still, then suddenly dash after a ball, flick it over and keep it in play. It was the kind of con game Gilbert used to play when he had to find a way, any way, to break an opponent's concentration.

''As long as I played tennis, everything was under control,'' Moya said. ''Then I started thinking about something else. The problem was that I was leading pretty easily, 6-4, 4-1 with two breaks. I thought everything was done. If it was more tight, I would have been focused. When I wanted to play well again, I couldn't.''

Agassi and Moya had never played each other, and Agassi said he was helped by a thorough scouting report from the voluble Gilbert.

''Tremendously so,'' Agassi said. ''If anything, I have to tell him before the match, 'Listen, the hay is in the barn. All the information is in, it's computed, I just need a little space right now.'

''But, yeah, it's very significant because you want to have a pretty good perspective going out there. Nothing's quite the same until you play the person. But Brad made me feel good about the fact that, shot for shot, I was better than him. He felt like I could break down his backhand. He felt like, really, the only thing he did better than me was just move better on the clay, and if I executed my shots accordingly, I would control the match.''

At 1-4 in the second, Agassi broke Moya's serve three times in winning seven of the next eight games. Then he broke the Spaniard down for good with a dazzling scoop at the net and a sliding groundstroke at 6-5 in the third set.

''He was hurting me, stretching me around the court, just giving me a beating,'' Agassi said. ''I just felt like if I'm going to lose this, I need to lose it (hitting) my shots and playing bigger. There's always a chance you could miss and the match is over quickly. But once I got the offense, I actually believed I could win. I felt like I was hurting him.''

Moya, with a shocked and puzzled look on his face, seemed to break down mentally, shot by shot, game by game, until he had nothing left.

When his final forehand landed weakly in the bottom of the net after he chased down a lob by Agassi, Moya dropped his racket in disgust. Moments later, he gave it away to a fan on the way off the court.

Agassi, meanwhile, wanted to stay all evening. He bowed to each side of the stadium and blew kisses to the crowd, hamming it up to the hilt as the cheers cascaded down toward him.

Runner-up at Roland Garros in 1990 and 1991, and a semifinalist twice, he lost here in the first round last year, skipped the year before that and went out in the second round in 1996.

Now he stands within reasonable reach, and against all odds, of completing a career Grand Slam -- the first by an American since Don Budge won all four majors in 1938. Agassi won Wimbledon in 1992, the U.S. Open in 1994, and the Australian Open in 1995.

''It would be awesome to win this tournament,'' Agassi said. ''I've come so close. It's meant so much to me even before I won the other three. But there's so much tennis left. I've got nine more sets to win against some pretty tough players, so I'm not thinking about winning. I won't be thinking about winning till I'm serving championship point.''