-- The Internet music directory Napster must prevent its millions of devotees from swapping copyrighted songs, a federal appeals court ruled today in a decision that likely will lead the company to shut down much of its free service.

The ruling was a major victory for the entertainment establishment, which worried that no one would pay $17 for a Britney Spears CD when people can simply log on and copy it.

"They've landed a blow," Napster Inc. chief executive Hank Barry said of the ruling.

After deliberating three months, the 9th U.S. Circuit Court of Appeals rejected Napster's arguments that the swapping was legally protected fair use under the copyright laws partly because Napster makes no money off of it.

"Direct economic benefit is not required to demonstrate a commercial use," the three judges wrote in their opinion. "Rather, repeated and exploitative copying of copyrighted works, even if the copies are not offered for sale, may constitute a commercial use."

The appeals court ruling won't immediately shut down the Napster site. It directed a lower court to reword an earlier injunction; until the new injunction is issued, the site can operate as usual. Millions of computer users flocked to the site this past weekend to download songs in fear of an adverse appeals court ruling.

Hilary Rosen, president of the Recording Industry Association of America, declared the ruling a complete victory for Geffen Records, MCA Records, Sony Music Entertainment and the other music companies that brought the suit. "The court affirmed our legal decision on every count," Rosen said.

Rosen and her lawyers said the decision should effectively force Napster to close up shop as a free service. "Its days as an instrument for electronic shoplifting are over," said Charles J. Cooper, an attorney for the RIAA.

Independent experts agreed. "You can hear the shouts of joy from the Sony building 30 blocks north of here," said Bruce Forest, a vice president at the consulting firm Sapient.

Today's decision stemmed from the music industry's request that Napster be prevented from operating pending a trial on the merits of the case. District Court Judge Marilyn Hall Patel agreed but the 9th Circuit stayed the preliminary injunction after Napster appealed. At the time, the company said even temporary closure could force it to go out of business.

The 9th Circuit ruled today that the record companies had "substantially and primarily prevailed" on appeal, but they called the original injunction "overboard" and sent it back for retooling so that it affects only copyrighted material.

In essence, the court said the record companies now must supply Napster with a list of all material they have under copyright. If Napster then permits any of this material to be swapped, the court said, it could be found guilty of "vicarious copyright infringement."

Today's decision puts Napster in the same near-death position it was in last summer. Napster lawyer David Boies said he would ask the entire circuit court to review the case, and it's possible he could persuade the U.S. Supreme Court to get involved. But the odds of success in either of these venues are believed to be small.

"This is a unanimous decision that upholds the lower court," said Jeffrey Weingart, a copyright lawyer with Brown Raysman. "In virtually all areas, the judges found the court hadn't abused its discretion. That's the standard of review."

While the vast majority of material swapped by Napster users appears to be copyrighted, one of the company's defenses has always been that it doesn't know exactly what's going on.

Napster itself does not transfer material among its millions of users. Instead, it provides registered users -- 51 million of them, the company says, although many people have probably listed themselves multiple times -- with software they download off the Web. The software allows people to use the Napster system as a central directory to find one another -- and the music they've made available for copying. Napster itself possesses no copy of the music.

In order to find a piece of music, users merely type the name of a song or musician into a special search engine and the Napster service responds with a list identifying where the file is located. Click on any file listed and a digital copy of the song, usually recorded as an MP3 file, is transferred over the Internet to the user's computer. The song can then be played from the computer or re-copied onto a blank CD.

The court's ruling effectively allows artists and record companies to regain control of their copyright material online, according to Danny Goldberg, chief executive of Artemis Records.

Goldberg predicted the next few years would bring "confusion and chaos" as music companies experiment with online business models. "We still have to deal rapidly with the tremendous consumer interest in downloading music," Goldberg said.

However, because of today's ruling, those business models would be driven by record companies and artists, not Web sites operated by independent entrepreneurs like Napster developer Shawn Fanning. "I think [the ruling] means there will be an evolution, not a revolution," Goldberg said.

In music chatrooms, Napster fans expressed dismay and defiance. Many noted that they may well start trading music over alternative file-swapping services.

"Well looks like you will have to get the beach boys somewhere else," wrote a user who goes by the handle "Howard the Duck." To which "made it" replied: "Do you really believe that the free distribution of mp3's could be stopped by a court???"

Owing to the nature of Napster, it probably won't be. The Silicon Valley company's origins are now well-known: The technology was developed in May 1999 by college student Fanning and his friend Sean Parker; college students loved it so much that more than 100 schools have banned it; it was sued first by the RIAA and then by the heavy metal group Metallica for copyright infringement; and each time there are rumors about its demise, like this past weekend, more users than ever flock to the site.

The recording industry's Rosen said the ruling is important not only to the music industry, but also to any industry that plans to do business online, including software, movie and publishing. "The court's decisive and unanimous ruling today is a victory for all creators," she said.

It certainly cheered Jack Valenti, president of the Motion Picture Association of America -- a group that is having its own battles with those who would download films for free. "Copyright law is very much intact in the cyberspace world," said Valenti.

But support for the ruling was far from universal. "We are disappointed," said Gary Shapiro of the Consumer Electronics Association, a trade group which represents companies such as Mitsubishi and Panasonic. The ruling, if upheld, could discourage hardware companies from trying to introduce new technologies, Shapiro said.

In a sign that this issue won't go away, both sides are gearing up for a big fight. The RIAA last week signed former Senate majority leader Robert J. Dole as a strategic adviser on the Napster issue. In December, Napster hired Manus Cooney, the former chief counsel to the Senate Judiciary Committee, to head up its Washington operations.

Streitfeld reported from San Francisco, Stern from Washington.