Online journalists have the same rights as traditional reporters, a Californian court has ruled.
The case concerned leaks about Apple products
The decision was made in a case brought by Apple against a number of reporters who published information online about a future Apple product launch.
Apple filed the lawsuit to find out the source of the reporter's information.
But judges said that online journalists have the same right to protect the confidentiality of their sources as offline media.
"Today's decision is a victory for the rights of journalists, whether online or offline, and for the public at large," said Attorney Kurt Opsahl of the Electronic Frontier Foundation (EFF), a digital rights organisation who have been defending the journalists.
The case began when Apple sued a number of unknown individuals, or "John Does", who leaked information about the launch of a FireWire audio interface for the Mac music program Garage Band.
Details of the release were published on news sites PowerPage and Apple Insider.
Apple argued that as the leaked information was confidential, the publishers of the site had to reveal their sources.
The judges presiding over the case disagreed.
"We decline the implicit invitation to embroil ourselves in questions of what constitutes 'legitimate journalism'," they said.
"We can think of no workable test or principle that would distinguish 'legitimate' from 'illegitimate' news," they concluded.
The online journalists are protected by California's Shield Law, as well as the country's constitution, said the judges.
In an attempt to uncover the source of the leak Apple had also subpoenaed Nfox.com, the e-mail service provider for PowerPage, to hand over messages that may identify the leak.
However the judges ruled that the subpoena was unlawful.
It is not known whether Apple plan to appeal against the decision.