For more than 6 1/2 hours, Mats Wilander of Sweden stood at the base line like a matador and withstood each of John McEnroe's charges. He parried, he countered, he returned. And finally, because the attacker was just a little bit stronger, because he waited for his openings and took his shots when they came and made them deep, Wilander lost.

By the time it ended, it was hard to remember that they were fighting to win the quarterfinal round of the Davis Cup. It seemed they were fighting only for excellence.

But the crowd of 15,103, the largest indoor crowd in Davis Cup history, that stood and stomped and cheered, "U.S.A., U.S.A." after every change, before every service game and after it was over reminded them something else was at stake. Because McEnroe finally prevailed, 9-7, 6-2, 15-17, 3-6, 8-6, in the longest match he has ever played, the United States will meet Australia in the semifinals the week of Sept. 27 in Perth.

"It was like mind over matter," McEnroe said.

Surely, no one on the American team wanted or anticipated that it would come to this, a decisive final match. But when Anders Jarryd beat Brian Gottfried, substituting for an injured Eliot Teltscher, 6-4, 6-2, 6-2, in the first match of the day to tie the series at 2-2, the McEnroe-Wilander match became more than a glorified exhibition. They made it a glorious exhibition.

Just when it seemed that it could not get any better, it did. Arthur Ashe, the U.S. Davis Cup captain, said it was one of the five best matches he has ever seen, and he has seen a few. People know what can be expected from McEnroe, but the depths of Wilander were revealing.

Surely, when at age 17 he became the youngest man ever to win the French Open in May, he intimated what he is. He is far more than a clone. To call him that is demeaning. He is too much himself. "There's similarities, obviously, but I didn't feel like I was playing (Bjorn) Borg," McEnroe said. "I mean the guy's 17 years old and I said, 'If I lose to this guy I'm really old.' "

Although he may not be quite good enough to beat McEnroe yet, he was good enough to bring out the best in McEnroe--and the worst. McEnroe fretted; he fumed; he berated himself (and was roundly cheered every time) and officials; he kicked a television cameraman's camera; he banged a ball into the scoreboard and was penalized the first point ever in Davis Cup play. In between it all, he played superbly.

But not superbly enough to suit him, especially in the 32-game third set. He was ahead two sets to love, 4 games to 2. Wilander, who seemed so docile in the second set, saved four break points to make it 4-3. McEnroe became enraged at linesman Loren Egley for a call on Wilander's serve. He lost the game and apparently his cool. Wilander tied the set at 4-4 when McEnroe missed three volleys in a row, hit a net cord shot and watched as Wilander got it past him on the dead run with a lovely forehand passing shot.

It stayed that way for the next 23 games. Wilander saved one break point at 8-8 with three backhand winners. Again at 10-10, with McEnroe ahead, 40-30, Wilander saved a break with a forehand cross-court volley, one of the few times he came to the net.

The emotion rose until you thought it could not rise any more. McEnroe was serving aces when he needed them (28 to three for Wilander), pumping his fists in the air. Maintaining the status quo until the 31st game of the 2 hour 38 minute set. McEnroe went ahead, 40-30, when Wilander hit his backhand long. He was ready for the kill.

But Wilander wasn't. He hit a deadly passing shot, which McEnroe, at the net, barely got his racket on and hit long. He fell to the court in despair. Again they traded points, and again it was deuce. McEnroe got one of Wilander's few second serves (he made 82 percent of his first serves) to work with. A vicious forehand cross-court return pulled Wilander wide, and McEnroe hit a forehand volley the other way on Wilander's weak return. Again it was McEnroe's advantage.

But he returned the next serve wide and the score returned to deuce. The next point was like the match: unreal. On the dead run, McEnroe retrieved the ball from the corner and hit a forehand that hit the top of the net and bounced sky high. Wilander, who was going the wrong direction, turned back, put two hands on the racket and pushed the ball into the opposite corner. He had the point, another one and the game.

McEnroe, seemingly disconcerted, missed every one of his first serves in the 32nd game (he made 57 percent in the match) and double-faulted twice (10 in the match) to lose the game, the set and the initiative.

Wilander took the fourth set with relative ease, doing what he does best: staying back, hitting strong ground strokes that became increasingly precise as he became increasingly tired.

And so it was two sets apiece. The tension rose along with the crowd every time McEnroe rose to another occasion, as he did when he broke to go up, 2-0. But Wilander broke back with a powerful backhand passing shot down the line. And as even as it had been, it stayed. McEnroe sent service winner after service winner past Wilander. His mind was tired, his reflexes intact. At 6-6, the score deuce, he made two incredible volleys; a half-volley at his feet and another forehand volley on Wilander's return that gave him no time to think.

"In the fifth set I was feeling it. But I hung in there," said McEnroe. "At some point it seemed the match would go on forever . . . to go out there and not know what to do next against a guy that's 17 is a frustrating feeling."

The crowd could not sit down; the players could barely stand up. McEnroe went ahead on Wilander's serve with a forehand volley down the line. He was attacking every short ball he could. He went up, 40-15, when Wilander's cross-court forehand went wide. McEnroe's fists were in the air; his eyes beseeched the heavens for just a little bit more. Wilander saved a break point. But he netted a forehand to end it as quietly as it began.

"John found it somewhere," Ashe said after the match, the longest since the Davis Cup discarded the challenge round format in 1972. "He's never played a longer match in terms of games or time. He's entitled to go out and get drunk tonight."

Maybe he should take Wilander with him.