The justices, aiming to curtail what they called a "staggering" volume of piracy online, largely set aside concerns that new lawsuits would inhibit technology companies from developing the next iPod or other hi-tech gadgets or services.
The unanimous ruling on Monday is expected to have little immediate impact on consumers, although critics said it could lead companies to include digital locks to discourage illegal behaviour.
The justices left in place legal protections for companies that merely learn customers might be using products for illegal purposes.
The justices said copying digital files such as movies, music or software programmes "threatens copyright holders as never before" because it is so easy and popular, especially among young people.
Entertainment companies maintain that online thieves trade 2.6 billion songs, movies and other digital files each month.
"I am pleased that the Supreme Court has considered this important case and determined that those who intentionally induce or encourage the theft of copyrighted music, movies, software or other protected works may be held liable for their actions," Attorney-General Alberto Gonzales said.
"We will no longer have to compete with thieves in the night whose businesses are built on larceny"
Andrew Lack, chief executive for Sony BMG Music Entertainment
The ruling represents a significant victory for Hollywood and record labels, which have resorted to suing individually the thousands of computer users caught sharing music and movies online.
"We will no longer have to compete with thieves in the night whose businesses are built on larceny," said Andrew Lack, chief executive for Sony BMG Music Entertainment.
In a tweak at entertainment companies - and a demonstration of legal purposes for file-sharing - computer users circulated the court's published opinion over internet file-sharing services.
Government-produced documents generally are not protected by copyright.
The court said Grokster Ltd. and Streamcast Networks Inc., developers of leading internet file-sharing software, can be sued because they deliberately encouraged customers to download copyrighted files illegally so they could build a larger audience and sell more advertising.
Writing for the court, Justice David H Souter said the companies' "unlawful objective is unmistakable".
The court noted as evidence of bad conduct that Grokster and Streamcast made no effort to block illegal downloads, which the companies maintained was not possible.
Hollywood has sued thousands of
computer users sharing movies
But the court also said a technology company could not be sued if it merely learns its customers are using its products for illegal purposes.
That balancing test, the court said, is necessary so that it "does nothing to compromise legitimate commerce or discourage innovation having a lawful promise".
The court said it wanted to protect inventors from having to predict how consumers months or years in the future might use new technology.
"The price of a wrong guess ... could be large," Justice Stephen Breyer wrote.
The lawyer for the software companies, Richard Taranto, said he would argue in a new trial that they did not encourage computer users to download music and movies illegally.
He complained the Supreme Court's ruling was so vague it was impossible to know which companies might be sued.
"You can't be terribly sure how it might apply to you," Taranto said.
Taranto's partner in the case, Fred von Lohmann of the San Francisco-based Electronic Frontier Foundation, predicted the decision would "unleash a new era of legal uncertainty on America's innovators" and that unresolved questions "will probably tie up courts for a long time".
Justices said a federal appeals court in California mistakenly applied too broadly a landmark 1984 Supreme Court ruling.
The court decided in the case that Sony Corp. could not be sued over consumers who used its VCRs to make illegal copies of movies because most people used VCRs legally to tape programmes and watch them later.
Hollywood and music labels hailed
"Nothing in Sony requires courts to ignore evidence of intent to promote infringement," the court said. It declined to go further, saying it wanted "to leave further consideration of the Sony rule for a day when that may be required".
Monday's decision did not affect the illegality of computer users downloading copyrighted materials over the internet without permission.
The ruling was also not expected to affect the thousands of copyright lawsuits already filed against computer users by the trade groups for Hollywood studios and the largest music labels.